summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaryam Tahhan <maryam.tahhan@intel.com>2017-09-11 13:13:21 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2017-09-11 13:15:14 +0100
commit4fb9d69005df446c4c3dd859fc106db1b0fe20b1 (patch)
tree6858595ceff26e2aaec4653408eed4d86c0816c1
parent31d1e783092774c8f117e32a8dac97ca3e6931ad (diff)
barometer: update nightly build
Update nightly build to only push the RPMs if they all exist. Also, only push the properties files if all the RPM pushes are successful. Change-Id: Ied64e203504ae6092c6ea3d21b474649584860ac Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
-rw-r--r--jjb/barometer/barometer-upload-artifact.sh34
1 files changed, 31 insertions, 3 deletions
diff --git a/jjb/barometer/barometer-upload-artifact.sh b/jjb/barometer/barometer-upload-artifact.sh
index 817cc5770..08c64bae7 100644
--- a/jjb/barometer/barometer-upload-artifact.sh
+++ b/jjb/barometer/barometer-upload-artifact.sh
@@ -2,6 +2,7 @@
set -o nounset
set -o pipefail
+RPM_LIST=$WORKSPACE/ci/utilities/rpms_list
RPM_WORKDIR=$WORKSPACE/rpmbuild
RPM_DIR=$RPM_WORKDIR/RPMS/x86_64/
cd $WORKSPACE/
@@ -9,9 +10,32 @@ cd $WORKSPACE/
# source the opnfv.properties to get ARTIFACT_VERSION
source $WORKSPACE/opnfv.properties
-# upload property files
-gsutil cp $WORKSPACE/opnfv.properties gs://$OPNFV_ARTIFACT_URL/opnfv.properties > gsutil.properties.log 2>&1
-gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
+# Check if all the appropriate RPMs were generated
+echo "Checking if all the Barometer RPMs were created"
+echo "-----------------------------------------------"
+echo
+
+if [ -d $RPM_DIR]
+then
+ ls $RPM_DIR > list_of_gen_pack
+else
+ echo "Can't access folder $RPM_DIR with rpm packages"
+ echo "Barometer nightly build FAILED"
+ exit 1
+fi
+
+for PACKAGENAME in `cat $RPM_LIST`
+do
+ if ! grep -q $PACKAGENAME list_of_gen_pack
+ then
+ echo "$PACKAGENAME is missing"
+ echo "Barometer nightly build FAILED"
+ exit 2
+ fi
+done
+
+#remove the file you no longer need.
+rm list_of_gen_pack
echo "Uploading the barometer RPMs to artifacts.opnfv.org"
echo "---------------------------------------------------"
@@ -25,6 +49,10 @@ if [[ $? -ne 0 ]]; then
echo "Problem while uploading barometer RPMs to gs://$OPNFV_ARTIFACT_URL!"
echo "Check log $WORKSPACE/gsutil.log on the appropriate build server"
exit 1
+else
+ # upload property files only if build is successful
+ gsutil cp $WORKSPACE/opnfv.properties gs://$OPNFV_ARTIFACT_URL/opnfv.properties > gsutil.properties.log 2>&1
+ gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
fi
gsutil -m setmeta \