From b44088b82f371a82a01dd29388220b36e6d3e0f7 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 26 Aug 2024 18:21:55 +0200 Subject: [PATCH 1/4] Set qpa and pythonpath --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3b1d220..7b5e7ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -237,6 +237,9 @@ WORKDIR /data ENTRYPOINT [ "/tini", "--", "/usr/local/bin/uid_entrypoint.sh" ] +ENV PYTHONPATH="/usr/share/qgis/python/" +ENV QT_QPA_PLATFORM=offscreen + EXPOSE 5000 CMD [ "/usr/local/bin/run.sh" ] From 05e66d50f3d3ee3dc3be3e3b30990fe3cfe3a37f Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 26 Aug 2024 18:31:06 +0200 Subject: [PATCH 2/4] Test --- .github/workflows/build.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d685d69..59cc71d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,10 @@ on: branches: - main + pull_request: + branches: + - main + schedule: - cron: '30 5 * * *' @@ -55,9 +59,29 @@ jobs: QGIS_VERSION_SHORT=${{ env.QGIS_VERSION_SHORT }} cache-to: type=local,dest=cache - - name: Build and push release + - name: Build release uses: docker/build-push-action@v3 if: env.DO_BUILD == 'true' + with: + context: . + push: false + build-args: | + QGIS_VERSION=${{ env.QGIS_VERSION_TAG }} + QGIS_VERSION_SHORT=${{ env.QGIS_VERSION_SHORT }} + cache-from: type=local,src=cache + tags: | + ghcr.io/opengisch/qgis-slim:latest + ghcr.io/opengisch/qgis-slim:${{ matrix.release_line }} + ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_SHORT }} + ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_PATCH }} + + - name: Test + run: | + docker run --rm -it ghcr.io/opengisch/qgis-slim:latest python3 -c 'from qgis.core import QgsApplication; QgsApplication([], False)' + + - name: Push release + uses: docker/build-push-action@v3 + if: env.DO_BUILD == 'true' && github.event_name != 'pull_request' with: context: . push: true @@ -71,6 +95,7 @@ jobs: ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_SHORT }} ghcr.io/opengisch/qgis-slim:${{ env.QGIS_VERSION_PATCH }} + # - name: Build and push debug # uses: docker/build-push-action@v3 # if: env.DO_BUILD == 'true' From 5027c5356ac8b75706137348c324299495537f70 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 26 Aug 2024 20:51:23 +0200 Subject: [PATCH 3/4] Input device is not a tty --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59cc71d..8067e0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: - name: Test run: | - docker run --rm -it ghcr.io/opengisch/qgis-slim:latest python3 -c 'from qgis.core import QgsApplication; QgsApplication([], False)' + docker run --rm ghcr.io/opengisch/qgis-slim:latest python3 -c 'from qgis.core import QgsApplication; QgsApplication([], False)' - name: Push release uses: docker/build-push-action@v3 From 5cd1494bd07d3a92c464fc040c3f3fb0440132b7 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 27 Aug 2024 07:44:48 +0200 Subject: [PATCH 4/4] Load before test --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8067e0d..7081128 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,11 +60,12 @@ jobs: cache-to: type=local,dest=cache - name: Build release - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 if: env.DO_BUILD == 'true' with: context: . push: false + load: true build-args: | QGIS_VERSION=${{ env.QGIS_VERSION_TAG }} QGIS_VERSION_SHORT=${{ env.QGIS_VERSION_SHORT }} @@ -80,7 +81,7 @@ jobs: docker run --rm ghcr.io/opengisch/qgis-slim:latest python3 -c 'from qgis.core import QgsApplication; QgsApplication([], False)' - name: Push release - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 if: env.DO_BUILD == 'true' && github.event_name != 'pull_request' with: context: .