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
456abf6b
Commit
456abf6b
authored
9 months ago
by
Grégoire Kubler
Browse files
Options
Downloads
Patches
Plain Diff
chore : formatting
parent
df557de2
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/download/select_jobs.gitlab-ci.yml
+11
-8
11 additions, 8 deletions
.gitlab/ci/download/select_jobs.gitlab-ci.yml
with
11 additions
and
8 deletions
.gitlab/ci/download/select_jobs.gitlab-ci.yml
+
11
−
8
View file @
456abf6b
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
echo "**"
echo "**"
echo "** RETRIEVING \$DEP_NAME
\
'S PROJECT ID"
echo "** RETRIEVING \$DEP_NAME'S PROJECT ID"
echo "**"
echo "**"
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
DEP_BRANCHES=$(curl -s "$API_URL/projects/$DEP_ID/repository/branches")
DEP_BRANCHES=$(curl -s "$API_URL/projects/$DEP_ID/repository/branches")
echo "Choosing a branch to pull dependending if we are in a Non draft merge request or not."
echo "Choosing a branch to pull dependending if we are in a Non draft merge request or not."
echo "CI_MERGE_REQUEST_TITLE = $CI_MERGE_REQUEST_TITLE"
echo "CI_MERGE_REQUEST_TITLE = $CI_MERGE_REQUEST_TITLE"
if [[ ! -z "$CI_MERGE_REQUEST_ID" && $CI_MERGE_REQUEST_TITLE != *'Draft'* ]]; then # case we are in a merge request
if [[ ! -z "$CI_MERGE_REQUEST_ID" &&
"
$CI_MERGE_REQUEST_TITLE
"
!= *'Draft'* ]]; then # case we are in a merge request
set +x
set +x
# If the MR is not in draft: pulling from target branch (if exists otherwise dev)
# If the MR is not in draft: pulling from target branch (if exists otherwise dev)
echo "NON DRAFT MERGE REQUEST Pipeline detected : Pulling from CI_MERGE_REQUEST_TARGET_BRANCH_NAME \"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME\"."
echo "NON DRAFT MERGE REQUEST Pipeline detected : Pulling from CI_MERGE_REQUEST_TARGET_BRANCH_NAME \"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME\"."
...
@@ -100,6 +100,7 @@
...
@@ -100,6 +100,7 @@
echo "**"
echo "**"
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
echo "****************************************************************************************************************************"
######################################################################################################
######################################################################################################
# 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
...
@@ -120,10 +121,10 @@
...
@@ -120,10 +121,10 @@
fi
fi
set -x
set -x
PIPELINES=$(
PIPELINES=$(
jq \
jq
\
-n \
-n
\
--argjson pipelines "$PIPELINES" \
--argjson pipelines "$PIPELINES"
\
--argjson mr_pipelines "$MR_PIPELINES" \
--argjson mr_pipelines "$MR_PIPELINES"
\
--arg project_namespace "$CI_PROJECT_NAMESPACE" \
--arg project_namespace "$CI_PROJECT_NAMESPACE" \
'$pipelines + $mr_pipelines
'$pipelines + $mr_pipelines
| map(select(.web_url | test($project_namespace)))
| map(select(.web_url | test($project_namespace)))
...
@@ -170,13 +171,15 @@
...
@@ -170,13 +171,15 @@
echo "Retrieving only part of the job json for readbility"
echo "Retrieving only part of the job json for readbility"
set -x
set -x
JOBS="$(jq --arg job_name "$DEPENDENCY_JOB" \
JOBS="$(jq --arg job_name "$DEPENDENCY_JOB" \
--arg branch_name "$BRANCH_TO_PULL" \
--arg branch_name "$BRANCH_TO_PULL" \
--arg repo_name "$DEP_NAME" \
--arg repo_name "$DEP_NAME" \
--arg repo_id "$DEP_ID" \
'[
'[
map(select((.name == $job_name) and (.status == "success"))) |
map(select((.name == $job_name) and (.status == "success"))) |
.[] |
.[] |
{
{
repo : $repo_name,
repo : $repo_name,
repo_id : $repo_id
branch_to_pull : $branch_name,
branch_to_pull : $branch_name,
id, status, name, ref, created_at, updated_at,
id, status, name, ref, created_at, updated_at,
user : { id : .user.id, username : .user.username },
user : { id : .user.id, username : .user.username },
...
...
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