From: Boris Ranto Date: Wed, 14 Sep 2016 10:46:46 +0000 (+0200) Subject: calamari-clients-build: Various fixes and improvements X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=721554327fd07bb98239839eee8da643de85ed1b;p=ceph-build.git calamari-clients-build: Various fixes and improvements - 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 --- diff --git a/calamari-clients-build/build/build_rpm b/calamari-clients-build/build/build_rpm index 54a20bd2..6a8b3d4e 100644 --- a/calamari-clients-build/build/build_rpm +++ b/calamari-clients-build/build/build_rpm @@ -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