From b60f74d6e27505d7398c94f4c645a23ce6ed0649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 9 Jul 2020 09:49:04 +0200 Subject: [PATCH 1/5] Never push on latest branch, fix delete backport images fix rebuild branches, code style --- .github/workflows/clean-dockerhub-tag.yaml | 4 +--- .github/workflows/rebuild.yaml | 5 ++--- ci/clean-dockerhub-tag | 14 +++++++++++--- ci/publish | 5 +---- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/clean-dockerhub-tag.yaml b/.github/workflows/clean-dockerhub-tag.yaml index 5f3a7ab8..21f1f826 100644 --- a/.github/workflows/clean-dockerhub-tag.yaml +++ b/.github/workflows/clean-dockerhub-tag.yaml @@ -1,9 +1,7 @@ --- - name: Clean docker hub tags -on: - delete +on: delete jobs: clean: diff --git a/.github/workflows/rebuild.yaml b/.github/workflows/rebuild.yaml index 1473f396..7c92464a 100644 --- a/.github/workflows/rebuild.yaml +++ b/.github/workflows/rebuild.yaml @@ -1,10 +1,9 @@ --- - name: Rebuild on: schedule: - - cron: "30 2 * * *" + - cron: '30 2 * * *' jobs: main: @@ -19,7 +18,7 @@ jobs: - master - '3.4' - '3.10' - - '3.12' + - '3.14' env: MAIN_BRANCH: master diff --git a/ci/clean-dockerhub-tag b/ci/clean-dockerhub-tag index 69540eb9..bb6d91f2 100755 --- a/ci/clean-dockerhub-tag +++ b/ci/clean-dockerhub-tag @@ -14,16 +14,22 @@ def clean(): token = requests.post( "https://hub.docker.com/v2/users/login/", headers={"Content-Type": "application/json"}, - data=json.dumps({"username": os.environ["USERNAME"], "password": os.environ["PASSWORD"]}), + data=json.dumps( + {"username": os.environ["USERNAME"], "password": os.environ["PASSWORD"]} + ), ).json()["token"] with open(os.environ["GITHUB_EVENT_PATH"]) as event_file: ref = json.loads(event_file.read())["ref"] + ref = ref.replace("/", "_") + print("Delete image 'camptocamp/qgis-server:{}'.".format(ref)) response = requests.head( - "https://hub.docker.com/v2/repositories/camptocamp/qgis-server/tags/{tag}/".format(tag=ref), + "https://hub.docker.com/v2/repositories/camptocamp/qgis-server/tags/{tag}/".format( + tag=ref + ), headers={"Authorization": "JWT " + token}, ) if response.status_code == 404: @@ -34,7 +40,9 @@ def clean(): sys.exit(2) response = requests.delete( - "https://hub.docker.com/v2/repositories/camptocamp/qgis-server/tags/{tag}/".format(tag=ref), + "https://hub.docker.com/v2/repositories/camptocamp/qgis-server/tags/{tag}/".format( + tag=ref + ), headers={"Authorization": "JWT " + token}, ) if not response.ok: diff --git a/ci/publish b/ci/publish index ae62cbd7..75737b94 100755 --- a/ci/publish +++ b/ci/publish @@ -2,10 +2,7 @@ if [ $# -gt 0 ] then - TAG="$1" -elif [[ "${GITHUB_REF}" == "refs/heads/master" ]] -then - TAG=latest + TAG="$1" if elif [[ "${GITHUB_REF}" =~ ^refs/tags/.* ]] then TAG=$(echo "${GITHUB_REF}"|sed 's|^refs/tags/||g') From afbbbbd617297c4c54135a2e21a874f001ea4764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 9 Jul 2020 10:16:33 +0200 Subject: [PATCH 2/5] Auto update GDAL --- .github/dependabot.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/dependabot.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000..15e3f9a6 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,7 @@ +--- +version: 2 +updates: + - package-ecosystem: docker + schedule: + interval: weekly + time: '02:00' From d05029598b5316adbeb754f928766c40c6a9d0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 9 Jul 2020 10:17:34 +0200 Subject: [PATCH 3/5] Do the upgrade on the runner --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6499504a..3af6b336 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM osgeo/gdal:ubuntu-small-3.1.1 as builder LABEL maintainer="info@camptocamp.com" RUN apt update && \ - apt upgrade --assume-yes && \ apt install --assume-yes --no-install-recommends apt-utils software-properties-common && \ apt autoremove --assume-yes software-properties-common && \ LC_ALL=C DEBIAN_FRONTEND=noninteractive apt install --assume-yes --no-install-recommends cmake gcc \ @@ -69,6 +68,7 @@ ENV APACHE_CONFDIR=/etc/apache2 \ LANG=C.UTF-8 RUN apt-get update && \ + apt upgrade --assume-yes && \ apt-get install --assume-yes --no-install-recommends apt-utils software-properties-common && \ apt autoremove --assume-yes software-properties-common && \ apt-get update && \ From 4287f47b7ec63b5806358d1573abd86903fb18bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 9 Jul 2020 10:20:55 +0200 Subject: [PATCH 4/5] Use apt instead apt-get --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3af6b336..925cdeb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,12 +67,12 @@ ENV APACHE_CONFDIR=/etc/apache2 \ APACHE_LOG_DIR=/var/log/apache2 \ LANG=C.UTF-8 -RUN apt-get update && \ +RUN apt update && \ apt upgrade --assume-yes && \ - apt-get install --assume-yes --no-install-recommends apt-utils software-properties-common && \ + apt install --assume-yes --no-install-recommends apt-utils software-properties-common && \ apt autoremove --assume-yes software-properties-common && \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends \ + apt update && \ + DEBIAN_FRONTEND=noninteractive apt install --assume-yes --no-install-recommends \ libfcgi libgslcblas0 libqca-qt5-2 libqca-qt5-2-plugins libzip5 \ libqt5opengl5 libqt5sql5-sqlite libqt5concurrent5 libqt5positioning5 libqt5script5 \ libqt5webkit5 libqwt-qt5-6 libspatialindex6 libspatialite7 libsqlite3-0 libqt5keychain1 \ @@ -84,7 +84,7 @@ RUN apt-get update && \ libqt53dcore5 libqt53dextras5 libqt53dlogic5 libqt53dinput5 libqt53drender5 \ libqt5serialport5 libqt5quickwidgets5 libexiv2-27 libprotobuf17 libprotobuf-lite17 \ libgsl23 && \ - apt-get clean && \ + apt clean && \ rm -rf /var/lib/apt/lists/* # Be able to install font as nonroot From 06a7ad0b1d58925966e53dddba4ee8f14b017dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 10 Jul 2020 09:39:58 +0200 Subject: [PATCH 5/5] Don't install unexisting PyQt5.QtSvg --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 925cdeb1..58ab189d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -77,7 +77,7 @@ RUN apt update && \ libqt5opengl5 libqt5sql5-sqlite libqt5concurrent5 libqt5positioning5 libqt5script5 \ libqt5webkit5 libqwt-qt5-6 libspatialindex6 libspatialite7 libsqlite3-0 libqt5keychain1 \ python3 python3-pip python3-setuptools python3-pyqt5 python3-owslib python3-jinja2 python3-pygments \ - python3-pyqt5.qtsql PyQt5.QtSvg \ + python3-pyqt5.qtsql \ spawn-fcgi xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb \ apache2 libapache2-mod-fcgid grass-core \ python3-pyqt5.qsci python3-pil python3-psycopg2 python3-shapely libpython3-dev \