summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2016-09-01 13:22:13 +0200
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2016-09-01 13:24:37 +0200
commitb0583ec6a4fd0490ec2b4e6359b3cff83874dab5 (patch)
tree6bb722eee051d00a0a677f4f1a3d8c5f67ff89bc
parentfcca04ef6b382db87e76540052bc57e8df593692 (diff)
kvmfornfv: Store the metadata for the artifacts built by daily jobs
Change-Id: I338401a1ced29b7907e74bea6ff28f5a6e80e5df Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
-rwxr-xr-xjjb/kvmfornfv/kvmfornfv-upload-artifact.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh
index 327ea97e8..422626ead 100755
--- a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh
+++ b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh
@@ -11,6 +11,7 @@ fi
case "$JOB_TYPE" in
verify)
+ OPNFV_ARTIFACT_VERSION="gerrit-$GERRIT_CHANGE_NUMBER"
GS_UPLOAD_LOCATION="gs://artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
echo "Removing outdated artifacts produced for the previous patch for the change $GERRIT_CHANGE_NUMBER"
gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1 && gsutil rm -r $GS_UPLOAD_LOCATION
@@ -26,11 +27,31 @@ case "$JOB_TYPE" in
exit 1
esac
+# save information regarding artifacts into file
+(
+ echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
+ echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
+ echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
+ echo "OPNFV_ARTIFACT_URL=$GS_UPLOAD_LOCATION"
+ echo "OPNFV_BUILD_URL=$BUILD_URL"
+) > $WORKSPACE/opnfv.properties
+
+# upload artifacts
gsutil cp -r $WORKSPACE/build_output/* $GS_UPLOAD_LOCATION > $WORKSPACE/gsutil.log 2>&1
gsutil -m setmeta -r \
-h "Cache-Control:private, max-age=0, no-transform" \
$GS_UPLOAD_LOCATION > /dev/null 2>&1
+# upload metadata file for the artifacts built by daily job
+if [[ "$JOB_TYPE" == "daily" ]]; then
+ gsutil cp $WORKSPACE/opnfv.properties $GS_UPLOAD_LOCATION/opnfv.properties > $WORKSPACE/gsutil.log 2>&1
+ gsutil cp $WORKSPACE/opnfv.properties $GS_URL/latest.properties > $WORKSPACE/gsutil.log 2>&1
+ gsutil -m setmeta -r \
+ -h "Cache-Control:private, max-age=0, no-transform" \
+ $GS_UPLOAD_LOCATION/opnfv-${OPNFV_ARTIFACT_VERSION}.properties \
+ $GS_URL/latest.properties > /dev/null 2>&1
+fi
+
gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Problem while uploading artifacts!"