diff --git a/.gitlab/ci/shared_script.gitlab-ci.yml b/.gitlab/ci/shared_script.gitlab-ci.yml index 59ad55727075023620ceed6f722e2725c7532855..dfdbd6dc8f8bcf2b1b8873771221410fd7ab3a82 100644 --- a/.gitlab/ci/shared_script.gitlab-ci.yml +++ b/.gitlab/ci/shared_script.gitlab-ci.yml @@ -24,7 +24,14 @@ BRANCH_TO_PULL=${CI_COMMIT_REF_NAME} fi - apt-get install -y jq - - DEPENDENCY_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id') + # Check group namespace is valid, if not DEPENDENCY_ID=6437 (aidge group ID) + - > + if [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}") -eq 404 ]; then + DEPENDENCY_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id') + else + echo "Using aidge group id by default" + DEPENDENCY_ID=6437 + fi - echo "Project ID for ${DEPENDENCY_NAME} is ${DEPENDENCY_ID}" - echo "curling from https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/artifacts/$BRANCH_TO_PULL/download?job=$DEPENDENCY_JOB"