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
7e86a3ba
Commit
7e86a3ba
authored
6 months ago
by
Grégoire Kubler
Browse files
Options
Downloads
Patches
Plain Diff
fix : indentation & missing "fi"
parent
8bee407e
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
+23
-22
23 additions, 22 deletions
.gitlab/ci/download/select_jobs.gitlab-ci.yml
with
23 additions
and
22 deletions
.gitlab/ci/download/select_jobs.gitlab-ci.yml
+
23
−
22
View file @
7e86a3ba
...
...
@@ -88,16 +88,16 @@
######################################
# CASE WHERE A COMMIT TAG IS CREATED
elif [[ ! -z "$CI_COMMIT_TAG" ]]; then
# retrieving data from current project
TAG_MAJOR=$(echo "$CI_COMMIT_TAG" | awk -F'[v.]' '{print $2}')
TAG_MINOR=$(echo "$CI_COMMIT_TAG" | awk -F'[v.]' '{print $3}')
TAG_FIX=$(echo "$CI_COMMIT_TAG" | awk -F'[v.]' '{print $4}')
# retrieving data from current project
TAG_MAJOR=$(echo "$CI_COMMIT_TAG" | awk -F'[v.]' '{print $2}')
TAG_MINOR=$(echo "$CI_COMMIT_TAG" | awk -F'[v.]' '{print $3}')
TAG_FIX=$(echo "$CI_COMMIT_TAG" | awk -F'[v.]' '{print $4}')
echo "Retrieving tags of $DEP_NAME via url $DEP_API_URL/repository/tags?per_page=100."
DEP_TAGS=$(jq --slurp '
.[]
| sort_by(.commit.created_at)
| reverse
' <<<$(curl -s "$DEP_API_URL/repository/tags?per_page=100"))
DEP_TAGS=$(jq --slurp '
.[]
| sort_by(.commit.created_at)
| reverse
' <<<$(curl -s "$DEP_API_URL/repository/tags?per_page=100"))
if [[ $(jq length <<< $DEP_TAGS) == 0 ]]; then
echo "No tag found for $DEP_NAME at url $DEP_API_URL/repository/tags?per_page=100"
...
...
@@ -114,19 +114,20 @@
SELECTED_DEPS_TAGS=$(jq --arg major "$TAG_MAJOR" \
--arg minor "$TAG_MINOR" \
'map(select(.name | startswith("v\($major).\($minor).")))' <<< "$DEP_TAGS")
if [[ $(jq length <<< $SELECTED_DEPS_TAGS) == 0 ]]; then
echo "No release v$TAG_MAJOR.$TAG_MINOR.* found. Looking for latest minor release v$TAG_MAJOR.*.* in $DEP_NAME."
SELECTED_DEPS_TAGS=$(jq --arg major "$TAG_MAJOR" \
'map(select(.name | startswith("v\($major).")))' <<< "$DEP_TAGS")
fi
if [[ $(jq length <<< $SELECTED_DEPS_TAGS) > 0 ]]; then
BRANCH_TO_PULL=$(jq -r '.[0].name' <<<"$SELECTED_DEPS_TAGS")
echo "Found a release with corresponding $BRANCH_TO_PULL"
else
echo "No release v$TAG_MAJOR.*.* found. Simply retrieving latest release v*.*.* in $DEP_NAME."
BRANCH_TO_PULL=$(jq -r '.[0].name' <<<"$DEP_TAGS")
fi
echo "Found release : $BRANCH_TO_PULL. Using it as \$BRANCH_TO_PULL."
fi
if [[ $(jq length <<< $SELECTED_DEPS_TAGS) == 0 ]]; then
echo "No release v$TAG_MAJOR.$TAG_MINOR.* found. Looking for latest minor release v$TAG_MAJOR.*.* in $DEP_NAME."
SELECTED_DEPS_TAGS=$(jq --arg major "$TAG_MAJOR" \
'map(select(.name | startswith("v\($major).")))' <<< "$DEP_TAGS")
fi
if [[ $(jq length <<< $SELECTED_DEPS_TAGS) > 0 ]]; then
BRANCH_TO_PULL=$(jq -r '.[0].name' <<<"$SELECTED_DEPS_TAGS")
echo "Found a release with corresponding $BRANCH_TO_PULL"
else
echo "No release v$TAG_MAJOR.*.* found. Simply retrieving latest release v*.*.* in $DEP_NAME."
BRANCH_TO_PULL=$(jq -r '.[0].name' <<<"$DEP_TAGS")
fi
echo "Found release : $BRANCH_TO_PULL. Using it as \$BRANCH_TO_PULL."
###########################################
# CASE CASUAL COMMIT or Draft MR PIPELINE
...
...
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