]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add job to update BIND9 Docker images for release
authorAndoni Duarte Pintado <andoni@isc.org>
Thu, 19 Feb 2026 09:04:51 +0000 (10:04 +0100)
committerAndoni Duarte (GitLab job 6980082) <andoni@isc.org>
Fri, 6 Mar 2026 09:25:00 +0000 (09:25 +0000)
This commit adds a new CI job to update the BIND9 version in the
isc-projects/bind9-docker project, which will cause the docker images
to be rebuilt for release. Previously a manual step.

A notification is sent to the relevant Mattermost channel.

(cherry picked from commit 0ad724558ec0e66b3125250a3ac92197a9b864f6)

.gitlab-ci.yml

index bf56801afa3492cbf0da135b37105b6b305fc5f4..8d497f8f0a51907407b6d922c4493f2a9f6f7ac3 100644 (file)
@@ -2071,6 +2071,39 @@ publish:
       - printing-press/
     when: on_failure
 
+# Job updating the Docker image for a specific release
+
+update-docker-image:
+  <<: *base_image
+  <<: *manual_release_job
+  variables:
+    RELEASE_DIRECTORY: "bind-${CI_COMMIT_TAG}-release"
+  script:
+    - VERSION="${CI_COMMIT_TAG#v}"
+    - CHECKSUM="$(sha256sum "${RELEASE_DIRECTORY}/bind-${VERSION}.tar.xz" | awk '{print $1}')"
+    - BRANCH="${CI_COMMIT_TAG%.*}"
+    - DOCKER_PROJECT="https://gitlab.isc.org/isc-projects/bind9-docker"
+    - CLONE_URL="https://oauth2:${BIND_TEAM_WRITE_TOKEN}@${DOCKER_PROJECT#https://}"
+    - git clone --depth 1 --branch "${BRANCH}" "${CLONE_URL}" docker-project
+    - cd docker-project
+    - sed -E -i Dockerfile -e "s/^(ARG BIND9_VERSION=).*/\1${VERSION}/"
+    - sed -E -i Dockerfile -e "s/^(ARG BIND9_CHECKSUM=).*/\1${CHECKSUM}/"
+    - git commit -m "Version bump to ${VERSION}" Dockerfile
+    - git push
+    - COMMIT_SHA="$(git log -n1 --format=%H)"
+    - MSG="Docker image for BIND ${BRANCH} updated to version ${CI_COMMIT_TAG}, commit [${COMMIT_SHA}](${DOCKER_PROJECT}/-/commit/${COMMIT_SHA})"
+    - |
+      curl -s -o /dev/null -X POST -H "Content-Type: application/json" -d '{"channel": "packaging", "text": "'"${MSG}"'"}' "${MATTERMOST_WEBHOOK_URL}"
+  needs:
+    - job: release
+      artifacts: true
+    - job: publish
+      artifacts: false
+  rules:
+    - *rule_tag_open_source
+  tags:
+    - smalljob
+
 # Job creating the release announcement MR in Printing Press
 
 prepare-release-announcement: