]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
CI: Do not rebuild Docker images for test builds for new branches
authorMaria Matejka <mq@ucw.cz>
Wed, 16 Apr 2025 18:36:17 +0000 (20:36 +0200)
committerMaria Matejka <mq@ucw.cz>
Thu, 17 Apr 2025 16:27:36 +0000 (18:27 +0200)
New branch considers all files changed. We don't want to rebuild all
docker images for new branches; that's just a waste of time and energy.

There is a better way for future -- a much better fine-grained control
may be obtained by running secondary pipelines.

fixes #212

.gitlab-ci.yml

index 59afb1d97bdf28a6eef37c2f288fbc179b29440e..58726a24010686a99a696667d7bf73b081321cb8 100644 (file)
@@ -44,13 +44,19 @@ stages:
   # That's Docker in Docker
   - dind
   rules:
-  - if: '$CI_COMMIT_TAG'
     # Never rebuild for tags
+  - if: '$CI_COMMIT_TAG'
     when: never
-  - changes:
+
+    # Never rebuild for new branches
+  - if: $CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000"
+    when: never
+
     # Do any change in Dockerfile (e.g. change a comment) to rebuild the image
+  - changes:
     - misc/docker/$IMG_NAME/Dockerfile
     when: always
+
   - when: never
 
 docker-docbuilder: