diff --git a/build-ubunturepo b/build-ubunturepo index a44c886c8..141c3c41c 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -26,6 +26,7 @@ # # LOG= - provide an LOG file option to redirect some output into log file # +# BUILDDESTDIR= - Copy build core tarball to BUILDDESTDIR if defined # For the dependency packages 1. All the xcat dependency deb packages should be uploaded to # "pokgsa/projects/x/xcat/build/ubuntu/xcat-dep/debs/" on GSA # 2. run ./build-ubunturepo -d @@ -400,6 +401,17 @@ __EOF__ chgrp root $tar_name chmod g+w $tar_name + if [ "$BUILDDESTDIR" ]; then + rm -rf $BUILDDESTDIR + mkdir -p $BUILDDESTDIR + cp $tar_name $BUILDDESTDIR + if [ $? != 0 ]; then + echo "Failed to copy $tar_name to $BUILDDESTDIR" + else + echo "Copied $tar_name to $BUILDDESTDIR" + fi + fi + if [ ! -e core-snap ]; then ln -s xcat-core core-snap fi diff --git a/buildcore.sh b/buildcore.sh index f1b7794d9..295d6ffbc 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -30,7 +30,7 @@ # VERBOSE=1 - to see lots of verbose output # LOG= - provide an LOG file option to redirect some output into log file # RPMSIGN=0 or RPMSIGN=1 - Sign the RPMs using the keys on GSA, the default is to sign the rpms without RPMSIGN specified - +# BUILDDESTDIR= - Copy build core tarball to BUILDDESTDIR if defined # # The following environment variables can be modified if you need # @@ -569,6 +569,17 @@ fi chgrp $SYSGRP $TARNAME chmod g+w $TARNAME +if [ "$BUILDDESTDIR" ]; then + rm -rf $BUILDDESTDIR + mkdir -p $BUILDDESTDIR + cp $TARNAME $BUILDDESTDIR + if [ $? != 0 ]; then + echo "Failed to copy $TARNAME to $BUILDDESTDIR" + else + echo "Copied $TARNAME to $BUILDDESTDIR" + fi +fi + # Decide whether to upload or not if [ -n "$UP" ] && [ "$UP" == 0 ]; then exit 0;