Handle Release Candidate branches

pull/30/head
Peter Smythe 2023-09-30 15:50:49 +02:00 committed by Jody Garnett
parent d151510c1e
commit 66456cdf83
1 changed files with 17 additions and 11 deletions

View File

@ -9,7 +9,7 @@ function usage() {
echo "$0 <mode> <version> [<build>]" echo "$0 <mode> <version> [<build>]"
echo "" echo ""
echo " mode : The mode. Choose one of 'build', 'publish' or 'buildandpublish'" echo " mode : The mode. Choose one of 'build', 'publish' or 'buildandpublish'"
echo " version : The released version to build an docker image for (eg: 2.23.1, ${MAIN}-SNAPSHOT)" echo " version : The released version to build an docker image for (eg: 2.23.1, ${MAIN}-SNAPSHOT, ${MAIN}-RC)"
echo " build : Build number (optional)" echo " build : Build number (optional)"
} }
@ -26,18 +26,24 @@ else
BUILD=$3 BUILD=$3
fi fi
if [[ "${VERSION:0:4}" == "$MAIN" ]]; then if [[ "$VERSION" == *"-RC"* ]]; then
# main branch snapshot release # release candidate branch release
BRANCH=main BRANCH="${VERSION:0:4}-RC"
TAG=geoserver-docker.osgeo.org/geoserver:$MAIN.x TAG=geoserver-docker.osgeo.org/geoserver:$BRANCH
else else
if [[ "$VERSION" == *"-SNAPSHOT"* ]]; then if [[ "${VERSION:0:4}" == "$MAIN" ]]; then
# stable or maintenance branch snapshot release # main branch snapshot release
BRANCH="${VERSION:0:4}.x" BRANCH=main
TAG=geoserver-docker.osgeo.org/geoserver:$BRANCH TAG=geoserver-docker.osgeo.org/geoserver:$MAIN.x
else else
BRANCH="${VERSION:0:4}.x" if [[ "$VERSION" == *"-SNAPSHOT"* ]]; then
TAG=geoserver-docker.osgeo.org/geoserver:$VERSION # stable or maintenance branch snapshot release
BRANCH="${VERSION:0:4}.x"
TAG=geoserver-docker.osgeo.org/geoserver:$BRANCH
else
BRANCH="${VERSION:0:4}.x"
TAG=geoserver-docker.osgeo.org/geoserver:$VERSION
fi
fi fi
fi fi