-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
142 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,49 @@ | ||
.PHONY: tests | ||
SHELL = bash | ||
.ONESHELL: | ||
.PHONY: env | ||
|
||
test: | ||
# | ||
# plugin makefile | ||
# | ||
|
||
COMMITID=$(shell git rev-parse --short HEAD) | ||
|
||
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 | ||
$(MAKE) -C tests | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,50 @@ | ||
SHELL:=bash | ||
.ONESHELL: | ||
.PHONY: env | ||
|
||
|
||
COMMITID=$(shell git rev-parse --short HEAD) | ||
|
||
ifdef REGISTRY_URL | ||
REGISTRY_PREFIX=$(REGISTRY_URL)/ | ||
endif | ||
REGISTRY_URL ?= 3liz | ||
REGISTRY_PREFIX=$(REGISTRY_URL)/ | ||
|
||
# Qgis version flavor | ||
FLAVOR:=3.16 | ||
|
||
BECOME_USER:=$(shell id -u) | ||
BECOME_GROUP:=$(shell id -g) | ||
|
||
QGIS_IMAGE=$(REGISTRY_PREFIX)qgis-platform:$(FLAVOR) | ||
|
||
LOCAL_HOME ?= $(shell pwd) | ||
|
||
SRCDIR=$(shell realpath ..) | ||
|
||
test: | ||
mkdir -p $$(pwd)/.local $(LOCAL_HOME)/.cache | ||
mkdir -p $$(pwd)/.local $$(pwd)/.cache | ||
docker run --rm --name qgis-wfsoutputextension-test-$(FLAVOR)-$(COMMITID) -w /src/tests \ | ||
-u $(BECOME_USER) \ | ||
-u $(BECOME_USER):$(BECOME_GROUP) \ | ||
-v $(SRCDIR):/src \ | ||
-v $$(pwd)/.local:/.local \ | ||
-v $(LOCAL_HOME)/.cache:/.cache \ | ||
-v $$(pwd)/.cache:/.cache \ | ||
-e PIP_CACHE_DIR=/.cache \ | ||
-e PYTEST_ADDOPTS="$(TEST_OPTS)" \ | ||
$(QGIS_IMAGE) ./run-tests.sh | ||
$(QGIS_IMAGE) ./run-tests.sh $(PYTEST_ADDOPTS) | ||
|
||
clean: | ||
rm -rf $$(pwd)/.local $$(pwd)/.cache | ||
|
||
run: env | ||
docker compose up -V --force-recreate | ||
|
||
stop: | ||
docker compose down -v --remove-orphans | ||
|
||
env: | ||
@echo "Creating environment file for docker-compose" | ||
@cat <<-EOF > .env | ||
WORKDIR=$(shell pwd) | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '3.8' | ||
services: | ||
qgis-server: | ||
image: 3liz/qgis-map-server:${QGIS_VERSION} | ||
environment: | ||
QGSRV_CACHE_ROOTDIR: /srv/projects | ||
QGSRV_LOGGING_LEVEL: DEBUG | ||
QGSRV_USER: ${QGIS_USER_ID}:${QGIS_USER_GID} | ||
QGSRV_SERVER_WORKERS: '1' | ||
QGSRV_SERVER_PLUGINPATH: /srv/plugins | ||
QGSRV_MANAGEMENT_ENABLED: 'yes' | ||
QGSRV_MANAGEMENT_INTERFACES: '0.0.0.0' | ||
QGSRV_API_ENABLED_LANDING_PAGE: 'yes' | ||
QGSRV_SERVER_TIMEOUT: '300' | ||
QGIS_SERVER_TRUST_LAYER_METADATA: 'yes' | ||
QGSRV_CACHE_STRICT_CHECK: 'no' | ||
volumes: | ||
- ${WORKDIR}:/srv/plugins | ||
- ${WORKDIR}/tests/data:/srv/projects | ||
ports: | ||
- ${SERVER_HTTP_PORT}:8080 | ||
- ${SERVER_MANAGEMENT_PORT}:19876 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters