Skip to content
Snippets Groups Projects
Commit 6b49aa00 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Add debug print.

parent ea0b2484
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# - DEPENDENCY_NAME: Name of the dependency project # - DEPENDENCY_NAME: Name of the dependency project
# - DEPENDENCY_JOB: Name of the dependency job from which you want to pull artifacts # - DEPENDENCY_JOB: Name of the dependency job from which you want to pull artifacts
script: script:
- set -x
- apt-get -qq install -y jq - apt-get -qq install -y jq
- GITLAB_ECLIPSE_URL="https://gitlab.eclipse.org/" - GITLAB_ECLIPSE_URL="https://gitlab.eclipse.org/"
- API_URL="https://gitlab.eclipse.org/api/v4" - API_URL="https://gitlab.eclipse.org/api/v4"
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
BRANCH_TO_PULL=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} BRANCH_TO_PULL=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
fi fi
else # CASE CASUAL COMMIT else # CASE CASUAL COMMIT
echo "TEST : $GITLAB_ECLIPSE_URL/eclipse/$CI_PROJECT_NAMESPACE/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME"
# checking if given branch exist on official repo or on fork # checking if given branch exist on official repo or on fork
RETURN_HTTP_CODE_OFFICIAL_REPO=$(curl -s -o /dev/null -w "%{http_code}" "$GITLAB_ECLIPSE_URL/eclipse/$CI_PROJECT_NAMESPACE/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME") RETURN_HTTP_CODE_OFFICIAL_REPO=$(curl -s -o /dev/null -w "%{http_code}" "$GITLAB_ECLIPSE_URL/eclipse/$CI_PROJECT_NAMESPACE/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME")
RETURN_HTTP_CODE_FORK=$(curl -s -o /dev/null -w "%{http_code}" "$GITLAB_ECLIPSE_URL/$CI_PROJECT_NAMESPACE/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME") RETURN_HTTP_CODE_FORK=$(curl -s -o /dev/null -w "%{http_code}" "$GITLAB_ECLIPSE_URL/$CI_PROJECT_NAMESPACE/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME")
...@@ -36,12 +38,13 @@ ...@@ -36,12 +38,13 @@
fi fi
- echo "Pulling from branch:\"$BRANCH_TO_PULL\"" - echo "Pulling from branch:\"$BRANCH_TO_PULL\""
- > - >
if [[ ! $PULL_FROM_FORK ]]; then # nominal case : we are in the official project if [[ ! $PULL_FROM_FORK ]]; then # nominal case : we are in the official project
DEPENDENCY_ID=$(curl "${API_URL}/groups/${CI_PROJECT_NAMESPACE_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id') DEPENDENCY_ID=$(curl "${API_URL}/groups/${CI_PROJECT_NAMESPACE_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id')
else # case for fork else # case for fork
echo "Retrieving build_artifacts from user' forked project." echo "Retrieving build_artifacts from user' forked project."
USER_ID=$(curl "${API_URL}/users?username=${CI_PROJECT_ROOT_NAMESPACE}" | jq -r '.[0].id') USER_ID=$(curl "${API_URL}/users?username=${CI_PROJECT_ROOT_NAMESPACE}" | jq -r '.[0].id')
DEPENDENCY_ID=$(curl "${API_URL}/users/${USER_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id') DEPENDENCY_ID=$(curl "${API_URL}/users/${USER_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id')
fi fi
...@@ -66,11 +69,11 @@ ...@@ -66,11 +69,11 @@
fi fi
- echo "curling from \"${API_URL}/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts\"" - echo "curling from \"${API_URL}/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts\""
- curl --location --output build_artifacts.zip "${API_URL}/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts" - curl --location --output build_artifacts.zip "${API_URL}/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts"
- unzip -q -o build_artifacts.zip -d . - unzip -q -o build_artifacts.zip -d .
- rm -rf build_cpp - rm -rf build_cpp
- set +x
.download_dependency_windows: .download_dependency_windows:
# Note: # Note:
# For this script to work you need to define teh following variables # For this script to work you need to define teh following variables
......
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