Skip to content
Snippets Groups Projects
Commit c6c4bb52 authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

chore : better debug

parent ccfbb9ca
No related branches found
No related tags found
1 merge request!47Draft: TEST_CI_FORK_DO_NOT_MERGE
...@@ -15,7 +15,6 @@ build:ubuntu_cpp: ...@@ -15,7 +15,6 @@ build:ubuntu_cpp:
- apt-get -qq install -y jq - apt-get -qq install -y jq
# Check if a branch with the same name exist on the dependance repository # Check if a branch with the same name exist on the dependance repository
- BRANCH_TO_PULL="dev" # default branch - BRANCH_TO_PULL="dev" # default branch
- set -x
- > - >
if [ "$CI_MERGE_REQUEST_ID" ]; then if [ "$CI_MERGE_REQUEST_ID" ]; then
echo "Merge request pipeline detected" echo "Merge request pipeline detected"
...@@ -30,11 +29,9 @@ build:ubuntu_cpp: ...@@ -30,11 +29,9 @@ build:ubuntu_cpp:
# Pulling from branch with same name # Pulling from branch with same name
BRANCH_TO_PULL=$CI_COMMIT_REF_NAME BRANCH_TO_PULL=$CI_COMMIT_REF_NAME
fi fi
- set +x
- echo "Pulling from branch:\"$BRANCH_TO_PULL\"" - 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 # 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 # 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 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: ...@@ -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\"" 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" 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 else # case for fork
set -x
echo "Retrieving build_artifacts from hrouis' forked project." echo "Retrieving build_artifacts from hrouis' forked project."
USER_ID=17216 USER_ID=17216
DEPENDENCY_ID=$(curl 'https://gitlab.eclipse.org/api/v4/users/${USER_ID}/projects?search=${DEPENDENCY_NAME}') DEPENDENCY_ID=$(curl 'https://gitlab.eclipse.org/api/v4/users/${USER_ID}/projects?search=${DEPENDENCY_NAME}')
...@@ -51,8 +49,8 @@ build:ubuntu_cpp: ...@@ -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') 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\"" 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 curl --location "https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts" --output build_artifacts.zip
set +x
fi fi
- set +x
- unzip -q -o build_artifacts.zip -d . - unzip -q -o build_artifacts.zip -d .
- rm -rf build_cpp - rm -rf build_cpp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment