-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
90 lines (67 loc) · 1.64 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
SHELL = bash
.ONESHELL:
.PHONY: env
#
# wmts 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)
BECOME_GROUP:=$(shell id -g)
QGIS_IMAGE=$(REGISTRY_PREFIX)qgis-platform:$(FLAVOR)
LOCAL_HOME ?= $(shell pwd)
PYTHON:=python3
BUILDDIR:=build
DIST:=${BUILDDIR}/dist
manifest:
dirs:
mkdir -p $(DIST)
# Build dependencies
wheel-deps: dirs
pip wheel -w $(DIST) -r requirements.txt
wheel:
mkdir -p $(DIST)
$(PYTHON) setup.py bdist_wheel --dist-dir=$(DIST)
deliver:
twine upload -r storage $(DIST)/*
dist: dirs
rm -rf *.egg-info
$(PYTHON) setup.py sdist --dist-dir=$(DIST)
clean:
rm -rf *.egg-info
rm -rf $(BUILDDIR)
# Checke setup.cfg for flake8 configuration
lint:
@flake8
test: lint
mkdir -p $$(pwd)/.local $(LOCAL_HOME)/.cache
docker run --rm --name wmts-cache-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
run: env
cd tests && docker-compose up -V --force-recreate
stop:
cd tests && docker-compose down -v --remove-orphans
env:
@echo "Creating environment file for docker-compose"
@mkdir 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
EOF