Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jekyll-theme-lcsb-default
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R3
outreach
themes
jekyll-theme-lcsb-default
Merge requests
!35
Resolve "Automatically tag and publish on version change"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Automatically tag and publish on version change"
43-automatically-tag-and-publish-on-version-change
into
latest
Overview
0
Commits
7
Pipelines
1
Changes
1
Merged
Jacek Lebioda
requested to merge
43-automatically-tag-and-publish-on-version-change
into
latest
4 years ago
Overview
0
Commits
7
Pipelines
1
Changes
1
Expand
Closes
#43 (closed)
0
0
Merge request reports
Compare
latest
latest (base)
and
latest version
latest version
ebd904e1
7 commits,
4 years ago
1 file
+
8
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
.gitlab-ci.yml
+
8
−
7
Options
@@ -42,22 +42,23 @@ auto-tag:
variables
:
VERSION_FILE
:
"
lib/jekyll-theme-lcsb-default.rb"
TARGET_BRANCH
:
latest
only
:
changes
:
-
"
lib/jekyll-theme-lcsb-default.rb"
script
:
# Make sure that it is on latest, otherwise exit
# Make sure that it is on latest, otherwise exit
. THIS IS A WORKAROUND, AS HAVING BOTH ONLY AND RULES IS NOT POSSIBLE
-
'
[[
"${CI_COMMIT_BRANCH:-1}"
==
"$TARGET_BRANCH"
]]
&&
echo
"On
correct
branch
($CI_COMMIT_BRANCH)"
||
exit
0'
# Make sure that the version exists
-
VERSION=$(cat $VERSION_FILE | grep -o "\d\.\d\.\d")
# Make sure that the version exists and is correct, and put it in envvar
-
cat $VERSION_FILE | grep "VERSION" | tr -d A-z\"\= | tr -d ' '
-
VERSION=`cat $VERSION_FILE | grep "VERSION" | tr -d A-z\"\= | tr -d ' '`
-
'
[[
-z
$VERSION
]]
&&
exit
-1
||
echo
"OK,
version
appears
to
be
correct
->
$VERSION"'
# Create the tag
-
git tag -a $VERSION
-
git tag -a $VERSION
-m $VERSION
# Publish the tag
-
git push origin $VERSION
only
:
changes
:
-
"
lib/jekyll-theme-lcsb-default.rb"
# This will push the gem to ruby-gems when the repository has been tagged
release
:
Loading