From 54491e383289be6b3076a3f94c167133ca29c598 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 2 Feb 2015 16:41:37 -0500 Subject: [PATCH] On successful builds, clean up the generated directories and files created during the build so generated files are not accidently commited to git. Print a error message when rpmbuild fails --- confluent_server/buildrpm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/confluent_server/buildrpm b/confluent_server/buildrpm index a641885e..627f7dc7 100755 --- a/confluent_server/buildrpm +++ b/confluent_server/buildrpm @@ -7,3 +7,11 @@ python setup.py sdist > /dev/null 2>&1 cp dist/*.tar.gz ~/rpmbuild/SOURCES sed -e 's/#VERSION#/'$VERSION/ $PKGNAME.spec.tmpl > ~/rpmbuild/SPECS/$PKGNAME.spec rpmbuild -ba ~/rpmbuild/SPECS/$PKGNAME.spec 2> /dev/null |grep ^Wrote: +if [ $? -ne 0 ]; then + echo "[ERROR] rpmbuild returned non-zero, run: rpmbuild -ba ~/rpmbuild/SPECS/$PKGNAME.spec" + exit 1 +else + # Clean up the generated files in this directory + rm -rf $PKGNAME.egg-info dist setup.py +fi +exit 0