exit 1
fi
- if [ "$GIT_BRANCH_NAME" = "integration" ] || [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] || [ ${GIT_BRANCH_NAME:0:3} = "poc/" ] || [ ${GIT_BRANCH_NAME:0:7} = "bugfix/" ]; then
+ if [[ "$GIT_BRANCH_NAME" = "integration" ]] || [[ ${GIT_BRANCH_NAME:0:8} = "feature/" ]] || [[ ${GIT_BRANCH_NAME:0:3} = "poc/" ]] || [[ ${GIT_BRANCH_NAME:0:7} = "bugfix/" ]]; then
APPEND_TO_VERSION="experimental"
REPO="dev-${SUITE}"
- if [ "$GIT_BRANCH_NAME" = "integration" ]; then
+ if [[ "$GIT_BRANCH_NAME" = "integration" ]]; then
DISTRIBUTION="dev-integration"
else
# set proper DISTRIBUTION for feature branches
DISTRIBUTION=$(echo "dev-${GIT_BRANCH_NAME}" | tr '/' '-')
fi
- elif [ "$GIT_BRANCH_NAME" = "master" ] || [ ${GIT_BRANCH_NAME:0:7} = "hotfix/" ]; then
+ elif [[ "$GIT_BRANCH_NAME" = "master" ]] || [[ ${GIT_BRANCH_NAME:0:7} = "hotfix/" ]]; then
APPEND_TO_VERSION=""
DISTRIBUTION="production-proposed-updates"
else
APPEND_TO_VERSION="develop"
fi
- if [ ! -z "$APPEND_TO_VERSION" ]; then
+ if [[ ! -z "$APPEND_TO_VERSION" ]]; then
# remove -SNAPSHOT
VERSION=$(echo $VERSION | sed -s "s#-SNAPSHOT##g")
BUILD_START=$(date +%Y%m%d%H%M%S)
set -x # echo commands executed
# write correct debian/changelog
-if [ "$GIT_BRANCH_NAME" = "master" ] || [ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ]; then
+if [[ "$GIT_BRANCH_NAME" = "master" ]] || [[ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ]]; then
# generate debian/changelog entries since the last upload
git-dch -a --ignore-branch --no-full --no-meta --id-length=7 -N $VERSION
# make sure distribution in changelog is set correctly
fi
# check that we replaced things correctly...
D=$(dpkg-parsechangelog 2>/dev/null|grep ^Distribution:|cut -d " " -f2)
-if [ "$D" != "$DISTRIBUTION" ]; then
+if [[ "$D" != "$DISTRIBUTION" ]]; then
figlet "Wrong distribution!"
dpkg-parsechangelog
exit 1
cd $WORKSPACE
# push back to git repo if build from master or hotfix/
-if [ "$GIT_BRANCH_NAME" = "master" ] || [ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ]; then
+if [[ "$GIT_BRANCH_NAME" = "master" ]] || [[ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ]]; then
git add debian/changelog
git commit -m "Automatic commit by jenkins after build of $BUILD_NUMBER"
# ~ and : are not valid in git tags, replace them:
cleanup
# push back integration branch if we merged a feature branch
-if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] || [ ${GIT_BRANCH_NAME:0:7} = "bugfix/" ]; then
- if [[ "$BUILD_TRIGGERS" == *"merge"* ]]; then
+if [[ ${GIT_BRANCH_NAME:0:8} = "feature/" ]] || [[ ${GIT_BRANCH_NAME:0:7} = "bugfix/" ]]; then
+ if [[ "$BUILD_TRIGGERS" = *"merge"* ]]; then
git push origin integration
figlet "Pushed to integration."
git checkout origin/$GIT_BRANCH_NAME -b $GIT_BRANCH_NAME