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
6b49aa00
Commit
6b49aa00
authored
1 year ago
by
Cyril Moineau
Browse files
Options
Downloads
Patches
Plain Diff
Add debug print.
parent
ea0b2484
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_script.gitlab-ci.yml
+6
-3
6 additions, 3 deletions
.gitlab/ci/shared_script.gitlab-ci.yml
with
6 additions
and
3 deletions
.gitlab/ci/shared_script.gitlab-ci.yml
+
6
−
3
View file @
6b49aa00
...
@@ -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
...
...
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