]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
takora: only move artifacts when $BRANCH is defined
authorKen Dreyer <kdreyer@redhat.com>
Fri, 28 Aug 2015 13:45:21 +0000 (07:45 -0600)
committerKen Dreyer <kdreyer@redhat.com>
Fri, 28 Aug 2015 13:45:21 +0000 (07:45 -0600)
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.

takora/build/build

index b13b101bf661a67ad2d24211311ed294dd706add..fb760f1e0fdcbaaa5b6f27ea5f80a947bbf8996a 100644 (file)
@@ -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