From e0da2a3b2a6f17256f848d859daacbdcf4b5f847 Mon Sep 17 00:00:00 2001
From: Nicolas Richart <nicolas.richart@epfl.ch>
Date: Mon, 22 Jan 2024 21:31:00 +0100
Subject: [PATCH] Wrong folder for the config file

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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ff73c17..cfd94fb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -54,6 +54,7 @@ spack:setup:
         cd /spack/spack
         git fetch
         git checkout $SPACK_VERSION
+        cd -
       fi
 
     - /spack/spack/bin/spack -vv -d gpg trust $GPG_PRIVATE_KEY
@@ -64,12 +65,15 @@ spack:setup:
       EXTERNAL_REPOS=$(jq -r '.spack.repos | .[]' config.json)
       for repo in ${EXTERNAL_REPOS}
       do
+        repo_branch=$(jq -r ".spack.repos.${repo}.branch" config.json)
         if [ ! -d /stack/extra_repos/${repo} ]; then
-          git clone -b $(jq -r ".spack.repos.${repos}.branch" config.json) $(jq -r ".spack.repos.${repos}.url" config.json) /stack/extra_repos/$repo
+          url_branch=$(jq -r ".spack.repos.${repo}.url" config.json)
+          git clone -b ${repo_branch} ${url_branch} /stack/extra_repos/$repo
         else
           cd /stack/extra_repos/$repo
           git fetch
-          git checkout $(jq -r ".spack.repos.${repos}.branch" config.json)
+          git checkout ${repo_branch} config.json)
+          cd -
         fi
       done
 
-- 
GitLab