From: Mathias Klette Date: Tue, 23 Apr 2013 09:45:10 +0000 (+0200) Subject: update storage-extract: use branchname to determine correct distribution X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=e99348a43159db928d8c89fff6a6c07064e51141;p=profitbricks%2Fjenkins-build-scripts.git update storage-extract: use branchname to determine correct distribution --- diff --git a/extract_storage_kernel+modules.sh b/extract_storage_kernel+modules.sh index a2e5164..43bcaa3 100755 --- a/extract_storage_kernel+modules.sh +++ b/extract_storage_kernel+modules.sh @@ -29,24 +29,33 @@ function get_last_target_build_no() { 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