Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
core-services
jekyll-theme-lcsb-default
Commits
0601f156
Commit
0601f156
authored
Apr 08, 2020
by
Jacek Lebioda
Browse files
Resolve "Automatically tag and publish on version change"
parent
1f34e674
Changes
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
0601f156
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment