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

fix : syntax

parent 7cb2d4c0
No related branches found
No related tags found
1 merge request!47Draft: TEST_CI_FORK_DO_NOT_MERGE
...@@ -45,10 +45,11 @@ build:ubuntu_cpp: ...@@ -45,10 +45,11 @@ build:ubuntu_cpp:
DEPENDENCY_ID=$(curl --header "PRIVATE_TOKEN: $CI_JOB_TOKEN" "https://gitlab.eclipse.org/api/v4/users/${USER_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id') DEPENDENCY_ID=$(curl --header "PRIVATE_TOKEN: $CI_JOB_TOKEN" "https://gitlab.eclipse.org/api/v4/users/${USER_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id')
fi fi
# Retrieve latest successful $DEPENDENCY_JOB $BRANCH_TO_PULL # Retrieve latest successful $DEPENDENCY_JOB $BRANCH_TO_PULL
PIPELINES=$(curl -s --header "PRIVATE_TOKEN: $CI_JOB_TOKEN" "https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/pipelines?ref=${BRANCH_TO_PULL}&order_by=updated_at&sort=desc") - PIPELINES=$(curl -s --header "PRIVATE_TOKEN:$CI_JOB_TOKEN" "https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/pipelines?ref=${BRANCH_TO_PULL}&order_by=updated_at&sort=desc")
JOB_ID=-1 - JOB_ID=-1
# handle case where there is no branch with the same name # handle case where there is no branch with the same name
- >
for i in $(seq 0 $(jq length <<< "$PIPELINES")) for i in $(seq 0 $(jq length <<< "$PIPELINES"))
do do
PIPELINE_ID=$(jq --argjson idx $i '.[$idx].id' <<< $PIPELINES) PIPELINE_ID=$(jq --argjson idx $i '.[$idx].id' <<< $PIPELINES)
...@@ -58,14 +59,15 @@ build:ubuntu_cpp: ...@@ -58,14 +59,15 @@ build:ubuntu_cpp:
break break
fi fi
done done
- >
if( $JOB_ID == -1 ) ; then if( $JOB_ID == -1 ) ; then
echo "ERROR : no successful job \"$DEPENDENCY_JOB\" found in branch \"$BRANCH_TO_PULL\" for project \"$DEPENDENCY_NAME\"" echo "ERROR : no successful job \"$DEPENDENCY_JOB\" found in branch \"$BRANCH_TO_PULL\" for project \"$DEPENDENCY_NAME\""
else else
echo "Successful job \"$DEPENDENCY_JOB\" found in branch \"$BRANCH_TO_PULL\" for project \"$DEPENDENCY_NAME\"" echo "Successful job \"$DEPENDENCY_JOB\" found in branch \"$BRANCH_TO_PULL\" for project \"$DEPENDENCY_NAME\""
fi fi
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 --output build_artifacts.zip --header "PRIVATE_TOKEN: $CI_JOB_TOKEN" "https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts" - curl --location --output build_artifacts.zip --header "PRIVATE_TOKEN: $CI_JOB_TOKEN" "https://gitlab.eclipse.org/api/v4/projects/$DEPENDENCY_ID/jobs/$JOB_ID/artifacts"
- set +x - set +x
- unzip -q -o build_artifacts.zip -d . - unzip -q -o build_artifacts.zip -d .
......
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