diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml index 1cc940514f3bea2716e50b57676618321c3bf16d..4d8b2e813c2c0d75e82c4694bee8298183bf650c 100644 --- a/.gitlab/ci/build.gitlab-ci.yml +++ b/.gitlab/ci/build.gitlab-ci.yml @@ -14,9 +14,9 @@ build:ubuntu_cpp: # - !reference [.download_dependency, script] - apt-get -qq install -y jq # Check if a branch with the same name exist on the dependance repository + - BRANCH_TO_PULL="dev" # default branch + - set -x - > - set -x - BRANCH_TO_PULL="dev" # default branch if [ "$CI_MERGE_REQUEST_ID" ]; then echo "Merge request pipeline detected" if [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME") -eq 404 ]; then @@ -30,13 +30,14 @@ build:ubuntu_cpp: # Pulling from branch with same name BRANCH_TO_PULL=${CI_COMMIT_REF_NAME} fi - echo "Pull from branch : ${BRANCH_TO_PULL}" - set +x + - set +x + - echo "Pulling from branch :" + - echo "${BRANCH_TO_PULL}" # Check group namespace is valid, if it is then we are in the official project(aidge group id=6437), otherwise we pull from the fork + - set -x + - # nominal case : we are in the official project - > - set -x - # nominal case : we are in the official project if [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}") -ne 404 ]; then DEPENDENCY_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id') echo "curling from \"https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/artifacts/$BRANCH_TO_PULL/download?job=$DEPENDENCY_JOB\"" @@ -51,7 +52,7 @@ build:ubuntu_cpp: echo "curling from \"https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts\"" curl --location "https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts" --output build_artifacts.zip fi - set +x + - set +x - unzip -q -o build_artifacts.zip -d . - rm -rf build_cpp