From 6422eb80cd99d4c2a21f5434eb0764a24a9157d7 Mon Sep 17 00:00:00 2001
From: cmoineau <cyril.moineau@cea.fr>
Date: Wed, 31 Jan 2024 16:05:19 +0000
Subject: [PATCH] mv .gitlab/ci/shared_test.gitlab-ci.yml ->
 .gitlab/ci/shared_script.gitlab-ci.yml and clean script.

---
 ...gitlab-ci.yml => shared_script.gitlab-ci.yml} | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
 rename .gitlab/ci/{shared_test.gitlab-ci.yml => shared_script.gitlab-ci.yml} (75%)

diff --git a/.gitlab/ci/shared_test.gitlab-ci.yml b/.gitlab/ci/shared_script.gitlab-ci.yml
similarity index 75%
rename from .gitlab/ci/shared_test.gitlab-ci.yml
rename to .gitlab/ci/shared_script.gitlab-ci.yml
index 74eee42..97865b9 100644
--- a/.gitlab/ci/shared_test.gitlab-ci.yml
+++ b/.gitlab/ci/shared_script.gitlab-ci.yml
@@ -1,24 +1,20 @@
-stages:
-  - shared
-
-shared_job:
-  script:
-    - echo "Running shared script job"
-
 .download_dependency:
   script:
+    - DEFAULT_BRANCH="dev"
     # Check if a branch with the same name exist on the dependance repository
     - RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME")
     - >
       if [ "$CI_MERGE_REQUEST_ID" ]; then
         # Pulling from target branch
+        echo "Pull from ${$CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
         curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME/download?job=$JOB"
       elif [ "$RESPONSE_CODE" -eq 404 ]; then
-        # Pulling from main
-        curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/main/download?job=$JOB"
+        echo "Pull from ${DEFAULT_BRANCH}"
+        curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$DEFAULT_BRANCH/download?job=$JOB"
       else
         # Pulling from branch with same name
-        echo "pull from ${CI_COMMIT_REF_NAME}"
+        echo "Pull from ${CI_COMMIT_REF_NAME}"
         curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=$JOB"
       fi
     - unzip -o build_artifacts.zip -d .
+    - rm -rf build_cpp
-- 
GitLab