# 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
#############
cd $WORKSPACE
validateInput
+export
set -e # fail on error
set -x # echo commands executed
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
# show the changelog
dpkg-parsechangelog
-set +x
+# call cleanup function
cleanup
# push back integration branch if we merged a feature branch
fi
fi
-#TODO: remove this debug output
-export
+# the end