[librsvg-oci-images/sam/fixes: 1/2] Only push to the container repo if building on master



commit 40e133a390b0663c29a9c7b5347d345ed676c35d
Author: Sam Thursfield <sam afuera me uk>
Date:   Sat Dec 14 00:27:31 2019 +0100

    Only push to the container repo if building on master
    
    Otherwise, experimental feature branches might break librsvg's actual
    CI.

 .gitlab-ci.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a10a990..37bbd5b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,7 +21,12 @@ variables:
     - sed -i '/^mountopt =.*/d' /etc/containers/storage.conf
 
     - podman build --format=docker --pull -f ${DOCKERFILE} -t ${IMAGE} ${CONTEXT_DIR}
-    - podman push ${IMAGE}
+    - |
+      if [ "$CI_COMMIT_REF_NAME" = "master" ]; then
+          podman push ${IMAGE}
+      else
+          echo "Not pushing image, as we are on non-master branch $CI_COMMIT_REF_NAME"
+      fi
 
 # Expects $ARCH variable which should be the architexcture of the image ex. x86_64
 # Expects $DISTRO_NAME variable which should be the name of the distro image ex. ubuntu


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