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

fix : bash ?

parent fd47b66a
No related branches found
No related tags found
1 merge request!47Draft: TEST_CI_FORK_DO_NOT_MERGE
...@@ -14,9 +14,9 @@ build:ubuntu_cpp: ...@@ -14,9 +14,9 @@ build:ubuntu_cpp:
# - !reference [.download_dependency, script] # - !reference [.download_dependency, script]
- 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
- set -x
- > - >
set -x
BRANCH_TO_PULL="dev" # default branch
if [ "$CI_MERGE_REQUEST_ID" ]; then if [ "$CI_MERGE_REQUEST_ID" ]; then
echo "Merge request pipeline detected" echo "Merge request pipeline detected"
if [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME") -eq 404 ]; then if [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME") -eq 404 ]; then
...@@ -30,13 +30,14 @@ build:ubuntu_cpp: ...@@ -30,13 +30,14 @@ 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
echo "Pull from branch : ${BRANCH_TO_PULL}" - set +x
set +x - echo "Pulling from branch :"
- echo "${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
- > - >
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}") -ne 404 ]; then if [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}") -ne 404 ]; then
DEPENDENCY_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id') DEPENDENCY_ID=$(curl "https://gitlab.eclipse.org/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}/projects?search=${DEPENDENCY_NAME}" | jq -r '.[0].id')
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\""
...@@ -51,7 +52,7 @@ build:ubuntu_cpp: ...@@ -51,7 +52,7 @@ build:ubuntu_cpp:
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
fi fi
set +x - 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