aboutsummaryrefslogtreecommitdiffstats
path: root/travis.sh
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-03-03 17:23:35 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-03-03 17:35:34 +0100
commit73bd4a955222aa31a8feb067bedeca3d97d90b4f (patch)
tree6a9a92ea9b74fbde878a45aca08dce983225e523 /travis.sh
parent62e913b8c38f369b6ed059085082b155d21e8f6f (diff)
downloadsonarqube-73bd4a955222aa31a8feb067bedeca3d97d90b4f.tar.gz
sonarqube-73bd4a955222aa31a8feb067bedeca3d97d90b4f.zip
Fix build version of RC to not have "x.y-RCz.0.<build>"
The correct format is "x.y.0.<build>"
Diffstat (limited to 'travis.sh')
-rwxr-xr-xtravis.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/travis.sh b/travis.sh
index b4299fc8ceb..b68726d718e 100755
--- a/travis.sh
+++ b/travis.sh
@@ -64,8 +64,8 @@ function installJdk8 {
function fixBuildVersion {
export INITIAL_VERSION=`maven_expression "project.version"`
- # resolve suffix -SNAPSHOT
- without_suffix=`echo $INITIAL_VERSION | sed "s/-SNAPSHOT//g"`
+ # remove suffix -SNAPSHOT or -RC
+ without_suffix=`echo $INITIAL_VERSION | sed "s/-.*//g"`
IFS=$'.'
fields_count=`echo $without_suffix | wc -w`
@@ -76,13 +76,13 @@ function fixBuildVersion {
export BUILD_VERSION="$without_suffix.$TRAVIS_BUILD_NUMBER"
fi
- if [ "${without_suffix}" == "${INITIAL_VERSION}" ]; then
- # not a SNAPSHOT: milestone, RC or GA
- export PROJECT_VERSION=$INITIAL_VERSION
- else
+ if [ "${INITIAL_VERSION}" == *"-SNAPSHOT" ]; then
# SNAPSHOT
export PROJECT_VERSION=$BUILD_VERSION
mvn org.codehaus.mojo:versions-maven-plugin:2.2:set -DnewVersion=$PROJECT_VERSION -DgenerateBackupPoms=false -B -e
+ else
+ # not a SNAPSHOT: milestone, RC or GA
+ export PROJECT_VERSION=$INITIAL_VERSION
fi
echo "Build Version : $BUILD_VERSION"