Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gitlab_shared_files
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
aidge
gitlab_shared_files
Commits
577c2dea
Commit
577c2dea
authored
1 year ago
by
Cyril Moineau
Browse files
Options
Downloads
Patches
Plain Diff
Download dependency first version.
parent
38287f0b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab/ci/shared_test.gitlab-ci.yml
+11
-29
11 additions, 29 deletions
.gitlab/ci/shared_test.gitlab-ci.yml
with
11 additions
and
29 deletions
.gitlab/ci/shared_test.gitlab-ci.yml
+
11
−
29
View file @
577c2dea
...
@@ -7,36 +7,18 @@ shared_job:
...
@@ -7,36 +7,18 @@ shared_job:
.download_dependency
:
.download_dependency
:
script
:
script
:
-
echo "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/main/download?job=$JOB"
-
echo "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME"
# 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_NAME/-/tree/$C
URRENT_BRANCH
")
-
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$C
I_COMMIT_REF_NAME
")
-
>
-
>
if [ "$RESPONSE_CODE" -eq 404 ] || [ "$CI_MERGE_REQUEST_ID" ]; then
if [ "$CI_MERGE_REQUEST_ID" ]; then
echo "default to main branch"
# Pulling from target branch
curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/main/download?job=build:ubuntu_cpp"
curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME/download?job=$JOB"
elif [ "$RESPONSE_CODE" -eq 404 ]; then
# Pulling from main
curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/main/download?job=$JOB"
else
else
echo "pull from ${CURRENT_BRANCH}"
# Pulling from branch with same name
curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CURRENT_BRANCH/download?job=$JOB"
echo "pull from ${CI_COMMIT_REF_NAME}"
curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=$JOB"
fi
fi
# variables:
-
unzip -o build_artifacts.zip -d .
# MY_CUSTOM_FUNCTION: >
# 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
# # - 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
# # curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/${PROJECT_ID}/jobs/artifacts/main/download?job=build:ubuntu_cpp"
# # else
# # curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/${PROJECT_ID}/jobs/artifacts/${CI_COMMIT_BRANCH}/download?job=${JOB}"
# # fi
# }
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment