[gnome-control-center/iainl/coverage-install-udisks2] ci: Rebuild docker images any time a commit touches the dockerfile



commit 3d1ebd42a6a58dd23b4d0a27ef0e56874e0936aa
Author: Iain Lane <iainl gnome org>
Date:   Wed Feb 20 11:14:09 2019 +0000

    ci: Rebuild docker images any time a commit touches the dockerfile
    
    Currently they are built from cron, but we can use Gitlab's
    
      only:
        changes:
          - path
    
    support to also trigger on path changes. This is restricted to only work
    for pushes for master, so that branches / merge requests don't attempt
    to rebuild the image.

 .gitlab-ci.yml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 80e946127..b87c47a22 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -354,6 +354,9 @@ ppc64le:
   only:
     variables:
       - $CRON_TASK == "BUILD_CI_IMAGES"
+    changes:
+      - build-aux/ci/Dockerfile.*
+
 
   script:
     # Skip the build (if requested)
@@ -363,6 +366,19 @@ ppc64le:
         exit 0
       fi
 
+    - |
+      if [[ "${CI_COMMIT_REF_NAME}" != "master" ]]; then
+        echo "== Exiting, will only build CI images when pushing to master. =="
+        exit 0
+      fi
+
+    # Only when we have somewhere to publish to
+    - |
+      if [[ -z "${CI_REGISTRY}${CI_REGISTRY_IMAGE}${CI_REGISTRY_USER}${CI_REGISTRY_PASSWORD}" ]]; then
+        echo "== Exiting, CI registry not configured. =="
+        exit 0
+      fi
+
     # Get multiarch stuff
     - |
       if [[ -n "${TARGET_ARCH}" ]]; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]