Commit 3e1f619e authored by Dominik Charousset's avatar Dominik Charousset

Add [--nightly|--release] option to OBS script

parent ca2c0a57
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# $ make # $ make
# $ make test # $ make test
# $ make doc <-- this is a necessary step! # $ make doc <-- this is a necessary step!
# $ scripts/obs-commit-version.sh # $ scripts/obs-commit-version.sh [--nightly|--release]
# #
# In brief, it performs the following steps: # In brief, it performs the following steps:
# #
...@@ -37,8 +37,6 @@ set -o nounset ...@@ -37,8 +37,6 @@ set -o nounset
set -o errexit set -o errexit
# Script configuration (yet unlikely to change in the future). # Script configuration (yet unlikely to change in the future).
confReleaseBranch="master"
confNightlyBranch="develop"
confReleaseProject="devel:libraries:caf" confReleaseProject="devel:libraries:caf"
confNightlyProject="devel:libraries:caf:nightly" confNightlyProject="devel:libraries:caf:nightly"
confReleasePackage="caf" confReleasePackage="caf"
...@@ -72,20 +70,17 @@ versionMinor=$(echo "( $versionAsInt / 100 ) % 100" | bc) ...@@ -72,20 +70,17 @@ versionMinor=$(echo "( $versionAsInt / 100 ) % 100" | bc)
versionPatch=$(echo "$versionAsInt % 100" | bc) versionPatch=$(echo "$versionAsInt % 100" | bc)
versionAsStr="$versionMajor.$versionMinor.$versionPatch" versionAsStr="$versionMajor.$versionMinor.$versionPatch"
# Retrieve current branch from git. if [ "$1" = "--release" ] ; then
gitBranch=`git rev-parse --abbrev-ref HEAD`
if [ "$gitBranch" = "$confReleaseBranch" ] ; then
projectName="$confReleaseProject" projectName="$confReleaseProject"
packageName="$confReleasePackage" packageName="$confReleasePackage"
packageVersion="${versionAsStr}" packageVersion="${versionAsStr}"
elif [ "$gitBranch" = "$confNightlyBranch" ] ; then elif [ "$1" = "--nightly" ] ; then
projectName="$confNightlyProject" projectName="$confNightlyProject"
packageName="$confNightlyPackage" packageName="$confNightlyPackage"
packageVersion="${versionAsStr}_$(date +%Y%m%d)" packageVersion="${versionAsStr}_$(date +%Y%m%d)"
else else
# Don't prevent other branches from building, but issue a warning. # Don't prevent other branches from building, but issue a warning.
echo "Not on '$confReleaseBranch' or '$confNightlyBranch' branch. Exitting." >&2 echo "Use with either '--nightly' or '--release'. Exitting." >&2
exit exit
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment