-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
64 lines (48 loc) · 1.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
SHELL:=bash
.ONESHELL:
#
# tiles server plugin makefile
#
COMMITID=$(shell git rev-parse --short HEAD)
REGISTRY_URL ?= 3liz
REGISTRY_PREFIX=$(REGISTRY_URL)/
# Qgis version flavor
FLAVOR:=release
BECOME_USER:=$(shell id -u)
QGIS_IMAGE=$(REGISTRY_PREFIX)qgis-platform:$(FLAVOR)
LOCAL_HOME ?= $(shell pwd)
# Check setup.cfg for flake8 configuration
lint:
@flake8
test: lint
mkdir -p $$(pwd)/.local $(LOCAL_HOME)/.cache
docker run --rm --name qgis-py-server-test-$(COMMITID) -w /src \
-u $(BECOME_USER) \
-v $$(pwd):/src \
-v $$(pwd)/.local:/.local \
-v $(LOCAL_HOME)/.cache:/.cache \
-e PIP_CACHE_DIR=/.cache \
-e PYTEST_ADDOPTS="$(TEST_OPTS)" \
$(QGIS_IMAGE) ./tests/run-tests.sh
BECOME_USER:=$(shell id -u)
BECOME_GROUP:=$(shell id -g)
CACHEDIR:=.wmts_cache
PROJECT_NAME:=qgis_server_tiles
run: env
cd tests && docker compose -p $(PROJECT_NAME) up -V --force-recreate
stop:
cd tests && docker compose -p $(PROJECT_NAME) down -v --remove-orphans
.PHONY: env
env:
@echo "Creating environment file for docker-compose"
@mkdir -p tests/$(CACHEDIR)
@cat <<-EOF > tests/.env
WORKDIR=$(shell pwd)
CACHEDIR=$(CACHEDIR)
QGIS_VERSION=$(FLAVOR)
QGIS_USER_ID=$(BECOME_USER)
QGIS_USER_GID=$(BECOME_GROUP)
SERVER_HTTP_PORT=127.0.0.1:8888
SERVER_MANAGEMENT_PORT=127.0.0.1:19876
REGISTRY_PREFIX=${REGISTRY_PREFIX}
EOF