# it updates debian/changelog, builds the debian package(s) and uploads to our repo.
#
-SUITE=$1 # this has to be either squeeze or wheezy currently
-if [[ -z "${SUITE}" ]] ; then
- SUITE="squeeze"
- echo "Warning: SUITE not definied, defaulting to \"squeeze\"."
-fi
-VERSION=$(mvn -B -N help:evaluate -Dexpression=project.version 2>/dev/null| grep -v "^\[")
-FEATURE_BRANCHES=("feature/" "poc/" "integration")
-REPO=pb-${SUITE}
-
-function startswithElement () {
- local e
- local l
- for e in "${@:2}"; do
- l=${#e} # length of the element
- # test if element equals $1 with the length of element:
- [[ "$e" = "${1:0:$l}" ]] && return 0
- done
- return 1
-}
-
function cleanup {
echo cleaning up ...
# revert changelog changes
function validateSettings
{
- APPEND_TO_VERSION=""
-
+ REPO=pb-${SUITE}
+ VERSION=$(mvn -B -N help:evaluate -Dexpression=project.version 2>/dev/null| grep -v "^\[")
if [[ -z "${VERSION}" ]] ; then
echo "ERROR: Cannot get version from maven using 'mvn -B -N help:evaluate -Dexpression=project.version'"
mvn -B -N help:evaluate -Dexpression=project.version
exit 1
fi
- if startswithElement $GIT_BRANCH_NAME "${FEATURE_BRANCHES[@]}" ; then
+ if [ "$GIT_BRANCH_NAME" = "integration" ] || [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] || [ ${GIT_BRANCH_NAME:0:3} = "poc/" ]; then
+ APPEND_TO_VERSION="experimental"
+ REPO="dev-${SUITE}"
if [ "$GIT_BRANCH_NAME" = "integration" ] ; then
DISTRIBUTION="dev-integration"
else
# set proper DISTRIBUTION for feature branches
DISTRIBUTION=$(echo "dev-${GIT_BRANCH_NAME}" | tr '/' '-')
fi
- REPO="dev-${SUITE}"
- APPEND_TO_VERSION="experimental"
elif [ "$GIT_BRANCH_NAME" = "master" ] || [ ${GIT_BRANCH_NAME:0:7} = "hotfix/" ] ; then
+ APPEND_TO_VERSION=""
DISTRIBUTION="production-proposed-updates"
else
DISTRIBUTION="unstable"
#############
# MAIN
#############
+
+SUITE=$1 # this has to be either squeeze or wheezy currently
+if [[ -z "${SUITE}" ]] ; then
+ SUITE="squeeze"
+ echo "Warning: SUITE not defined, defaulting to \"squeeze\"."
+fi
cd $WORKSPACE
validateSettings
export