echo $retval
}
-if [ "$DISTRIBUTION" = "production-proposed-updates" ] ; then
+# overwrite PB_SUITE with branch name
+export PB_SUITE=$(echo $GIT_BRANCH_NAME | tr '/' '-' | sed -e "s/^\(feature\|bugfix\|poc\)-/dev-\1-/g")
+
+case $DISTRIBUTION in
+ production-proposed-updates)
export TARGET_NAME=master
-elif [ "$DISTRIBUTION" = "pre-staging" ] ; then
+ ;;
+ pre-staging)
export TARGET_NAME=develop
-elif [[ "$DISTRIBUTION" = dev-feature* ]] ; then
- export TARGET_NAME=$DISTRIBUTION
+ ;;
+ experimental)
+ export TARGET_NAME=$PB_SUITE
LAST_DEVELOP_BUILD_NO=$(get_last_target_build_no develop)
BUILD_NUMBER="$LAST_DEVELOP_BUILD_NO.$(printf %03d $BUILD_NUMBER)"
FEATURE_APTCMD="
echo \"deb http://alexandria.pb.local/dev-repository $DISTRIBUTION main contrib non-free\" \
> /etc/apt/sources.list.d/profitbricks-linux-image-storage-$DISTRIBUTION.list
"
-else
- echo "DISTRIBUTION must be 'production-proposed-updates', 'pre-staging', or 'dev-feature*'."
+ ;;
+ *)
+ echo "DISTRIBUTION must be 'production-proposed-updates', 'pre-staging', or 'experimental'."
echo "exiting."
figlet "FAIL"
exit 1
-fi
+ ;;
+esac
+
export TARGET_DIR=$TARGET_BASE/$TARGET_NAME/$BUILD_NUMBER
export JOB_HOME=$JENKINS_HOME/jobs/$JOB_NAME/builds