Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
installer
Commits
2181cd4f
Commit
2181cd4f
authored
Jul 30, 2021
by
Paul McCarthy
🚵
Browse files
CI: Make it necessary to update the fslinstaller __version__ field, block
deployment if it doesn't match tag
parent
075ed952
Changes
2
Hide whitespace changes
Inline
Side-by-side
.ci/new_release.sh
View file @
2181cd4f
...
...
@@ -7,11 +7,16 @@
# First we copy the installer into the deployment directory, denoted by the
# $FSLINSTALLER_DEPLOY_DIRECTORY environment variable.
# copy the installer to the deploy directory,
# stamping it with the new version number.
PATTERN
=
"s/^__version__ =.*/__version__ = '
$CI_COMMIT_TAG
'/g"
DEST
=
$FSLINSTALLER_DEPLOY_DIRECTORY
/fslinstaller.py
cat
fslinstaller.py |
sed
"
$PATTERN
"
>
$DEST
set
-e
# Make sure that the installer version matches the tag
scriptver
=
$(
cat
fslinstaller.py |
grep
"__version__ = "
|
cut
-d
" "
-f
3 |
tr
-d
"'"
)
if
[
"
$scriptver
"
!=
"
$CI_COMMIT_TAG
"
]
;
then
echo
"Version in fslinstaller.py does not match tag!
$scriptver
!=
$CI_COMMIT_TAG
"
exit
1
fi
# Then we call the update_manifest.py script, which opens a merge request
# on the fsl/conda/manifest repository, to update the latest available
...
...
.gitlab-ci.yml
View file @
2181cd4f
...
...
@@ -11,6 +11,7 @@
# be copied.
stages
:
-
test
-
check-version
-
release
# Don't run pipeline on MRs
...
...
@@ -79,6 +80,30 @@ test:py39:
extends
:
.test-template
image
:
python:3.9
check-version
:
stage
:
check-version
image
:
python:3.9
tags
:
-
fsl-ci
-
docker
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
!=
"master"'
script
:
-
git fetch origin master
-
thisver=$( cat fslinstaller.py | grep "__version__ = " | cut -d " " -f 3 | tr -d "'")
-
masterver=$(git show origin/master:fslinstaller.py | grep "__version__ = " | cut -d " " -f 3 | tr -d "'")
-
|
if [ "$thisver" = "$masterver" ]; then
echo "Version has not been updated!"
echo "Version on master branch: $masterver"
echo "Version in this MR: $thisver"
echo "The version number must be updated before this MR can be merged."
exit 1
else
echo "Version on master branch: $masterver"
echo "Version in this MR: $thisver"
fi
release
:
image
:
python:3.9
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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