From 8dff670041b5bce41f3e08073d3a9cb69a69d920 Mon Sep 17 00:00:00 2001
From: Christian Winter <c.winter@kit.edu>
Date: Mon, 30 Oct 2023 11:26:10 +0000
Subject: [PATCH] debug pipeline

---
 .gitlab-ci.yml | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fbb2494..31799d8 100755
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,8 +12,11 @@ variables:
     - changes: 
       - $IMAGE_NAME/Dockerfile
       - basis/*
+  needs:  # if the build_and_push step basis has to be done, then make the other build_and_push steps dependend of it
+    - job: basis
+      optional: true # only run if basis is added to the pipeline (depends on the rules).
   before_script:
-    - docker login -u $DOCKER_HUB_USER -p $DOCKER_TOKEN
+    - docker login -u "$DOCKER_HUB_USER" -p $DOCKER_TOKEN
   script:
       - docker build -t "$DOCKER_HUB_USER/etp_$IMAGE_NAME" $IMAGE_NAME/Dockerfile --no-cache;
       - docker push "$DOCKER_HUB_USER/etp_$IMAGE_NAME";
@@ -54,7 +57,7 @@ create_jupytermachine_version:
   script:
     - |
       IMAGES=( "basis" "tp" "python311") # "tp_herwig") #  "tp_geant" "cuda_basis"
-      docker login -u $DOCKER_HUB_USER -p $DOCKER_TOKEN
+      docker login -u "$DOCKER_HUB_USER" -p $DOCKER_TOKEN
       cd basis_jupytermachine
       for image in "${IMAGES[@]}"; do
 
@@ -62,7 +65,7 @@ create_jupytermachine_version:
         OLD_BASE_IMAGE=$(grep -E '^\s*FROM\s+.*' Dockerfile | awk '{print $2}');
         echo $OLD_BASE_IMAGE;
         # Replace "basic_jupytermachine" with the new base image name
-        NEW_BASE_IMAGE=$DOCKER_HUB_USER/etp_$image;
+        NEW_BASE_IMAGE="$DOCKER_HUB_USER/etp_$image";
         echo $NEW_BASE_IMAGE;
         sed -i "s#$OLD_BASE_IMAGE#$NEW_BASE_IMAGE#" "Dockerfile"
         cat Dockerfile;
-- 
GitLab