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' 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/Dockerfile b/Dockerfile index 4c8dc02c..31d9a34a 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 \ @@ -68,22 +67,23 @@ ENV APACHE_CONFDIR=/etc/apache2 \ APACHE_LOG_DIR=/var/log/apache2 \ LANG=C.UTF-8 -RUN apt-get update && \ - apt-get install --assume-yes --no-install-recommends apt-utils software-properties-common && \ +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 && \ - 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 \ 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 \ python3-pyqt5.qsci python3-pil python3-psycopg2 python3-shapely libpython3-dev \ 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 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')