From: Holger Levsen Date: Thu, 25 Jul 2013 12:41:25 +0000 (+0200) Subject: fix upload, add cleanup after upload, add some more comments X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=ab2e3c6397a178e37dd6b7a8ae81c1b6615f318e;p=profitbricks%2Fjenkins-build-scripts.git fix upload, add cleanup after upload, add some more comments --- diff --git a/maven_post_build_debian_wrapper.sh b/maven_post_build_debian_wrapper.sh index 823b767..410a6e0 100755 --- a/maven_post_build_debian_wrapper.sh +++ b/maven_post_build_debian_wrapper.sh @@ -59,9 +59,9 @@ function validateInput # set proper DISTRIBUTION for feature branches DISTRIBUTION=$(echo "dev-${GIT_BRANCH_NAME}" | tr '/' '-') fi - REPO="dev-squeeeze" + REPO="dev-squeeze" APPEND_TO_VERSION="experimental" - elif ! containsElement $DISTRIBUTION "${VALID_DISTROS[@]}" ; then + elif ! containsElement $DISTRIBUTION "${VALID_DISTROS[@]}" || [ -z "$DISTRIBUTION" ] ; then echo "\$DISTRIBUTION is set to $DISTRIBUTION but thats not a valid distribution, which are: $VALID_DISTROS" exit 1 if [ "$DISTRIBUTION" = "unstable" ] || [ "$DISTRIBUTION" = "pre-staging" ] ; then @@ -85,6 +85,7 @@ function validateInput ############# cd $WORKSPACE validateInput +export set -e # fail on error set -x # echo commands executed @@ -106,12 +107,15 @@ fi dpkg-buildpackage -us -uc -b # upload to reprepro -SOURCE=$(dpkg-parsechangelog 2>/dev/null|grep ^Source:|cut -d " " -f2) +SOURCE=$(dpkg-parsechangelog 2>/dev/null|grep ^Source:|cut -d " " -f2) # get the name of the source package +CHANGES_FILE=${SOURCE}_${VERSION}_amd64.changes cd $WORKSPACE/.. -# TODO: move configuration up -dcmd scp ${SOURCE}_${VERSION}_amd64.changes alexandria.pb.local:/srv/$REPO/incoming/profitbricks/ +# upload +dcmd scp $CHANGES_FILE reprepro@alexandria.pb.local:/srv/$REPO/incoming/profitbricks/ +# cleanp +dcmd rm $CHANGES_FILE +rm $CHANGES_FILE ${SOURCE}_${VERSION}_amd64.build cd $WORKSPACE -# TODO: cleanup uploaded files # push back to git repo if build from master or hotfix/ if [ "$GIT_BRANCH_NAME" = "master" ] || [ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ] ; then @@ -127,7 +131,7 @@ fi # show the changelog dpkg-parsechangelog -set +x +# call cleanup function cleanup # push back integration branch if we merged a feature branch @@ -138,5 +142,4 @@ if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] ; then fi fi -#TODO: remove this debug output -export +# the end