Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
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
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
1bc23201
Commit
1bc23201
authored
5 years ago
by
User expired
Browse files
Options
Downloads
Patches
Plain Diff
openolat#140: create new tags also when no previous can be found for this major.minor release
parent
d44aa8b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/uibk-release.sh
+7
-7
7 additions, 7 deletions
scripts/uibk-release.sh
with
7 additions
and
7 deletions
scripts/uibk-release.sh
+
7
−
7
View file @
1bc23201
...
@@ -15,7 +15,10 @@ echo "The last 5 (un)merged uibk tags:"
...
@@ -15,7 +15,10 @@ echo "The last 5 (un)merged uibk tags:"
echo
"The last 5 merged uibk tags:"
echo
"The last 5 merged uibk tags:"
/usr/bin/git tag
-l
--merged
HEAD
--sort
creatordate|grep
'\.uibk-'
|tail
-n
5
/usr/bin/git tag
-l
--merged
HEAD
--sort
creatordate|grep
'\.uibk-'
|tail
-n
5
LASTTAG
=
$(
/usr/bin/git tag
-l
--merged
HEAD
--sort
creatordate|grep
'\.uibk-'
|tail
-n
1
)
echo
"The last 5 merged uibk tags for this major, minor and patch version:"
/usr/bin/git tag
-l
--merged
HEAD
--sort
creatordate|grep
-F
"
${
CODE_VERSION_MMP
}
.uibk-"
|tail
-n
5
LASTTAG
=
$(
/usr/bin/git tag
-l
--merged
HEAD
--sort
creatordate|grep
-F
"
${
CODE_VERSION_MMP
}
.uibk-"
|tail
-n
1
)
LASTTAG_VERSION_MMPU
=
${
LASTTAG
#*OpenOLAT_
}
LASTTAG_VERSION_MMPU
=
${
LASTTAG
#*OpenOLAT_
}
LASTTAG_VERSION_MMP
=
${
LASTTAG_VERSION_MMPU
%.uibk*
}
LASTTAG_VERSION_MMP
=
${
LASTTAG_VERSION_MMPU
%.uibk*
}
LASTTAG_VERSION_MM
=
${
LASTTAG_VERSION_MMP
%.*
}
LASTTAG_VERSION_MM
=
${
LASTTAG_VERSION_MMP
%.*
}
...
@@ -25,11 +28,8 @@ set -e
...
@@ -25,11 +28,8 @@ set -e
echo
"Checking out the current head as the branch name we are building in:"
echo
"Checking out the current head as the branch name we are building in:"
git checkout
-B
"
$CI_BUILD_REF_NAME
"
"
$CI_BUILD_REF
"
git checkout
-B
"
$CI_BUILD_REF_NAME
"
"
$CI_BUILD_REF
"
echo
"Testing that the major and minor version of the last tag are equal to the one in olat.properties"
echo
"Testing that the major and minor version from olat.properties and the branch name match"
test
"
${
LASTTAG_VERSION_MM
}
"
=
"
${
CODE_VERSION_MM
}
"
test
"
${
CODE_VERSION_MM
}
"
=
"
${
GIT_REF_VERSION_MM
}
"
echo
"Testing that the major and minor version of the last tag are equal to the one in the branch name"
test
"
${
LASTTAG_VERSION_MM
}
"
=
"
${
GIT_REF_VERSION_MM
}
"
echo
"Check if the olat.properties patch release is the same as in our last tag"
echo
"Check if the olat.properties patch release is the same as in our last tag"
if
[[
"
$LASTTAG_VERSION_MMP
"
=
"
$CODE_VERSION_MMP
"
]]
if
[[
"
$LASTTAG_VERSION_MMP
"
=
"
$CODE_VERSION_MMP
"
]]
...
@@ -49,7 +49,7 @@ then
...
@@ -49,7 +49,7 @@ then
exit
1
exit
1
fi
fi
echo
"Test if the detached head commit (
$CI_COMMIT_SHA
) is equal to the release branch (
$CI_COMMIT_REF_NAME
)"
echo
"Test if the detached head commit (
$CI_COMMIT_SHA
) is equal to the release branch (
$CI_COMMIT_REF_NAME
)"
if
git diff
--
exit-code
$CI_COMMIT_SHA
origin/
$CI_COMMIT_REF_NAME
if
git diff
--
exit-code
$CI_COMMIT_SHA
origin/
$CI_COMMIT_REF_NAME
then
then
echo
"SHA and REF are equal so we can checkout the branch"
echo
"SHA and REF are equal so we can checkout the branch"
...
...
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