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
78c5a09d
Commit
78c5a09d
authored
6 months ago
by
Grégoire Kubler
Browse files
Options
Downloads
Patches
Plain Diff
chore : generalized DEP_API_URL call in ubuntu slect jobs
parent
1482934a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab/ci/download/select_jobs.gitlab-ci.yml
+7
-7
7 additions, 7 deletions
.gitlab/ci/download/select_jobs.gitlab-ci.yml
with
7 additions
and
7 deletions
.gitlab/ci/download/select_jobs.gitlab-ci.yml
+
7
−
7
View file @
78c5a09d
...
@@ -141,19 +141,19 @@
...
@@ -141,19 +141,19 @@
# Retrieve latest successful $DEPENDENCY_JOB from $BRANCH_TO_PULL (including MR pipelines)
# Retrieve latest successful $DEPENDENCY_JOB from $BRANCH_TO_PULL (including MR pipelines)
# and sort them from newest to oldest
# and sort them from newest to oldest
echo "Retrieving pipelines from $BRANCH_TO_PULL"
echo "Retrieving pipelines from $BRANCH_TO_PULL"
echo "Regular pipeline curled from \"$API_URL/
projects/$DEP_ID/
pipelines?ref=${BRANCH_TO_PULL}\""
echo "Regular pipeline curled from \"$
DEP_
API_URL/pipelines?ref=${BRANCH_TO_PULL}\""
PIPELINES=$(curl -s "$API_URL/
projects/$DEP_ID/
pipelines?ref=${BRANCH_TO_PULL}")
PIPELINES=$(curl -s "$
DEP_
API_URL/pipelines?ref=${BRANCH_TO_PULL}")
if [[ -z "$PIPELINES" ]]; then
if [[ -z "$PIPELINES" ]]; then
echo "Failed to retrieve any pipeline, ensure there is a pipeline with ref $BRANCH_TO_PULL in $DEP_NAME"
echo "Failed to retrieve any pipeline, ensure there is a pipeline with ref $BRANCH_TO_PULL in $DEP_NAME"
exit 1
exit 1
fi
fi
echo "Found $(jq length <<<$PIPELINES) regular pipelines with $BRANCH_TO_PULL as ref."
echo "Found $(jq length <<<$PIPELINES) regular pipelines with $BRANCH_TO_PULL as ref."
echo "Retrieve first affiliated MR by curling \"$API_URL/
projects/$DEP_ID/
merge_requests?source_branch=$BRANCH_TO_PULL&state=opened\""
echo "Retrieve first affiliated MR by curling \"$
DEP_
API_URL/merge_requests?source_branch=$BRANCH_TO_PULL&state=opened\""
MR_ID=$(curl -s "$API_URL/
projects/$DEP_ID/
merge_requests?source_branch=$BRANCH_TO_PULL&state=opened" | jq '.[0].iid')
MR_ID=$(curl -s "$
DEP_
API_URL/merge_requests?source_branch=$BRANCH_TO_PULL&state=opened" | jq '.[0].iid')
if [[ $MR_ID != null ]]; then
if [[ $MR_ID != null ]]; then
echo "MR pipeline curled from \"$API_URL/
projects/$DEP_ID/
merge_requests/$MR_ID/pipelines\""
echo "MR pipeline curled from \"$
DEP_
API_URL/merge_requests/$MR_ID/pipelines\""
MR_PIPELINES=$(curl -s "$API_URL/
projects/$DEP_ID/
merge_requests/$MR_ID/pipelines")
MR_PIPELINES=$(curl -s "$
DEP_
API_URL/merge_requests/$MR_ID/pipelines")
echo "Found $(jq length <<<$MR_PIPELINES) Merge Request pipelines with $BRANCH_TO_PULL as source_branch."
echo "Found $(jq length <<<$MR_PIPELINES) Merge Request pipelines with $BRANCH_TO_PULL as source_branch."
else
else
echo "No merge request with source_branch = \"$BRANCH_TO_PULL\" found."
echo "No merge request with source_branch = \"$BRANCH_TO_PULL\" found."
...
@@ -188,7 +188,7 @@
...
@@ -188,7 +188,7 @@
for i in $(seq 0 $(($(jq length <<<$PIPELINES) - 1))); do
for i in $(seq 0 $(($(jq length <<<$PIPELINES) - 1))); do
PIPELINE_ID=$(jq --argjson idx $i '.[$idx].id' <<<$PIPELINES)
PIPELINE_ID=$(jq --argjson idx $i '.[$idx].id' <<<$PIPELINES)
echo "Current pipeline ID : $PIPELINE_ID"
echo "Current pipeline ID : $PIPELINE_ID"
echo "Retrieving jobs of curr pipeline from : \"$API_URL/
projects/$DEP_ID/
pipelines/$PIPELINE_ID/jobs\""
echo "Retrieving jobs of curr pipeline from : \"$
DEP_
API_URL/pipelines/$PIPELINE_ID/jobs\""
JOBS=$(curl -s "$DEP_API_URL/pipelines/$PIPELINE_ID/jobs")
JOBS=$(curl -s "$DEP_API_URL/pipelines/$PIPELINE_ID/jobs")
if [[ $(jq -r '.message' <<<$JOBS) == "404 Not found" ]]; then
if [[ $(jq -r '.message' <<<$JOBS) == "404 Not found" ]]; then
echo "WARNING: NO JOBS FOUND FOR PIPELINE $PIPELINE_ID OF PROJECT $DEP_NAME."
echo "WARNING: NO JOBS FOUND FOR PIPELINE $PIPELINE_ID OF PROJECT $DEP_NAME."
...
...
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