From: Ken Dreyer Date: Fri, 28 Aug 2015 13:45:21 +0000 (-0600) Subject: takora: only move artifacts when $BRANCH is defined X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d68471657781b016716f0290a9c5e96ee81d620c;p=ceph-build.git takora: only move artifacts when $BRANCH is defined The purpose of this change is to make the build script work with both the "takora" job and the "takora-pull-requests" job. In the takora-pull-requests job, $BRANCH is undefined. We don't need to move the build artifacts, because we aren't going to save them. --- diff --git a/takora/build/build b/takora/build/build index b13b101bf..fb760f1e0 100644 --- a/takora/build/build +++ b/takora/build/build @@ -18,14 +18,19 @@ else tito rpm fi -cd $WORKSPACE -rm -rf $BRANCH -mkdir $BRANCH - -if [ $DEBIAN = 1 ] ; then - mv *.deb *.dsc *.changes *.tar.gz $BRANCH -else - find rpmbuild -name '*.rpm' -o -name '*.srpm' | xargs -i mv {} $BRANCH +if [ -n "$BRANCH" ] + # A user explicitly told Jenkins to build a branch. + # (ie, this is not an automatic GitHub pull request build.) + # Move the artifacts into position for archiving. + cd $WORKSPACE + rm -rf $BRANCH + mkdir $BRANCH + + if [ $DEBIAN = 1 ] ; then + mv *.deb *.dsc *.changes *.tar.gz $BRANCH + else + find rpmbuild -name '*.rpm' -o -name '*.srpm' | xargs -i mv {} $BRANCH + fi fi exit 0