]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
calamari-clients-build: Various fixes and improvements
authorBoris Ranto <branto@redhat.com>
Wed, 14 Sep 2016 10:46:46 +0000 (12:46 +0200)
committerBoris Ranto <branto@redhat.com>
Wed, 14 Sep 2016 11:17:53 +0000 (13:17 +0200)
- make sure the old src.rpms are removed before creating a new one
- automatically show mock logs if the build fails
- do not upload src.rpm twice, mock creates a srpm with proper dist,
  keep that one

Signed-off-by: Boris Ranto <branto@redhat.com>
calamari-clients-build/build/build_rpm

index 54a20bd22ac13621d1825beead40e4ee498e29f4..6a8b3d4e07b55916a798bdb9e9db535e0c8d726a 100644 (file)
@@ -79,6 +79,9 @@ echo "*****"
 # Install the dependencies
 sudo yum-builddep -y dist/calamari-clients.spec
 
+# Remove old source rpms
+rm -f *.src.rpm
+
 # Create the source rpm
 echo "Building SRPM"
 rpmbuild \
@@ -95,7 +98,13 @@ SRPM=$(readlink -f *.src.rpm)
 
 # Build the binaries
 echo "Building RPMs"
-sudo mock -r epel-${RELEASE}-${ARCH} --resultdir=./dist/rpm/"%(dist)s"/"%(target_arch)s"/ ${SRPM}
+if ! sudo mock -r epel-${RELEASE}-${ARCH} --resultdir=./dist/rpm/"%(dist)s"/"%(target_arch)s"/ ${SRPM}; then
+       for log in dist/rpm/*/*/*.log; do
+               echo -e "\nLOG: $(basename $log)"
+               cat "$log"
+       done
+       echo "ERROR: mock failed, see the build logs above"
+fi
 
 # Make sure we execute at the top level directory
 cd "$WORKSPACE"
@@ -104,7 +113,6 @@ cd "$WORKSPACE"
 
 if [ "$THROWAWAY" = false ] ; then
     # push binaries to chacra
-    echo "$SRPM" | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/source/
     find dist/rpm/$DIST/ | egrep '\.rpm$' | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/$ARCH/
 
     # start repo creation