diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml index 25bc8ce32a7180d1089d450bbdae53cf0858501d..09fbc937867b421f2fb4f9b11be91df60cb9f657 100644 --- a/.gitlab/ci/build.gitlab-ci.yml +++ b/.gitlab/ci/build.gitlab-ci.yml @@ -15,7 +15,6 @@ build:ubuntu_cpp: - 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 - > if [ "$CI_MERGE_REQUEST_ID" ]; then echo "Merge request pipeline detected" @@ -30,11 +29,9 @@ build:ubuntu_cpp: # Pulling from branch with same name BRANCH_TO_PULL=$CI_COMMIT_REF_NAME fi - - set +x - echo "Pulling from branch:\"$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 - > if [ "$(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}")" != "404" ]; then @@ -42,6 +39,7 @@ build:ubuntu_cpp: echo "curling from \"https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/artifacts/$BRANCH_TO_PULL/download?job=$DEPENDENCY_JOB\"" curl -f --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/artifacts/$BRANCH_TO_PULL/download?job=$DEPENDENCY_JOB" else # case for fork + set -x echo "Retrieving build_artifacts from hrouis' forked project." USER_ID=17216 DEPENDENCY_ID=$(curl 'https://gitlab.eclipse.org/api/v4/users/${USER_ID}/projects?search=${DEPENDENCY_NAME}') @@ -51,8 +49,8 @@ build:ubuntu_cpp: JOB_ID=$(curl "https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/pipelines/$PIPELINE_ID/jobs" | jq 'map(select(.name == ${DEPENDENCY_JOB})) | .[0].id') 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 + set +x fi - - set +x - unzip -q -o build_artifacts.zip -d . - rm -rf build_cpp