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

switch to a reference strategy.

parent c4f3c30f
No related branches found
No related tags found
No related merge requests found
...@@ -5,23 +5,30 @@ shared_job: ...@@ -5,23 +5,30 @@ shared_job:
script: script:
- echo "Running shared script job" - echo "Running shared script job"
variables: .download_dependency:
MY_CUSTOM_FUNCTION: > script:
function my_custom_function() { - local GROUP_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups?search=aidge" | jq -r '.[0].id')
local DEPENDENCY_NAME="$1" - echo "GROUP_ID $GROUP_ID "
local BRANCH_NAME="$2" - local PROJECT_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups/$GROUP_ID/projects?search=$DEPENDENCY_NAME" | jq -r '.[0].id')
local JOB="$3" - echo "project $DEPENDENCY_NAME id = $PROJECT_ID"
local GROUP_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups?search=aidge" | jq -r '.[0].id')
echo "GROUP_ID $GROUP_ID " # variables:
local PROJECT_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups/$GROUP_ID/projects?search=$DEPENDENCY_NAME" | jq -r '.[0].id') # MY_CUSTOM_FUNCTION: >
echo "project $DEPENDENCY_NAME id = $PROJECT_ID" # function my_custom_function() {
# local DEPENDENCY_NAME="$1"
# local BRANCH_NAME="$2"
# local JOB="$3"
# local GROUP_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups?search=aidge" | jq -r '.[0].id')
# echo "GROUP_ID $GROUP_ID "
# local PROJECT_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups/$GROUP_ID/projects?search=$DEPENDENCY_NAME" | jq -r '.[0].id')
# echo "project $DEPENDENCY_NAME id = $PROJECT_ID"
# # 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
# - RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/${DEPENDENCY}/-/tree/${CI_COMMIT_BRANCH}") # # - RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/${DEPENDENCY}/-/tree/${CI_COMMIT_BRANCH}")
# - > # # - >
# if [ "$RESPONSE_CODE" -eq 404 ] || [ "$CI_MERGE_REQUEST_ID" ]; then # # if [ "$RESPONSE_CODE" -eq 404 ] || [ "$CI_MERGE_REQUEST_ID" ]; then
# curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/${PROJECT_ID}/jobs/artifacts/main/download?job=build:ubuntu_cpp" # # curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/${PROJECT_ID}/jobs/artifacts/main/download?job=build:ubuntu_cpp"
# else # # else
# curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/${PROJECT_ID}/jobs/artifacts/${CI_COMMIT_BRANCH}/download?job=${JOB}" # # curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/${PROJECT_ID}/jobs/artifacts/${CI_COMMIT_BRANCH}/download?job=${JOB}"
# fi # # fi
} # }
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