summaryrefslogtreecommitdiffstats
path: root/jjb/xci/xci-promote.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/xci/xci-promote.sh')
-rwxr-xr-xjjb/xci/xci-promote.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/jjb/xci/xci-promote.sh b/jjb/xci/xci-promote.sh
index 62818abee..3a2367819 100755
--- a/jjb/xci/xci-promote.sh
+++ b/jjb/xci/xci-promote.sh
@@ -30,4 +30,24 @@ if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENT
exit 0
fi
-echo "Hello World!"
+# fail if promotion metadata file doesn't exist
+if [ ! -f $LOCAL_PROMOTION_METADATA_FILE ]; then
+ echo "Unable to find promotion metadata file $LOCAL_PROMOTION_METADATA_FILE"
+ echo "Skipping promotion!"
+ exit 1
+fi
+
+# upload promotion metadata file to OPNFV artifact repo
+echo "Storing promotion metadata as $REMOTE_PROMOTION_METADATA_FILE"
+gsutil cp $LOCAL_PROMOTION_METADATA_FILE $REMOTE_PROMOTION_METADATA_FILE
+
+# update the file metadata on gs to prevent the use of cached version of the file
+gsutil -m setmeta -r -h "Cache-Control:private, max-age=0, no-transform" \
+ $REMOTE_PROMOTION_METADATA_FILE > /dev/null 2>&1
+
+# log the metadata to console
+echo "Stored the metadata for $DEPLOY_SCENARIO"
+echo "---------------------------------------------------------------------------------"
+gsutil cat $REMOTE_PROMOTION_METADATA_FILE
+echo "---------------------------------------------------------------------------------"
+echo "Scenario $DEPLOY_SCENARIO has successfully been promoted!"