summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorFatih Degirmenci <fdegir@gmail.com>2018-03-19 14:25:29 +0100
committerFatih Degirmenci <fdegir@gmail.com>2018-03-19 14:25:29 +0100
commit448fdae19653c110b3d784861a7d14717e2c198b (patch)
tree8fb2fa7b251c8e429d7d0442e06f866beb16d3b6 /jjb
parent9dccbc7d59862b2c381fddcf4e6d6710ea2775d0 (diff)
xci: Store the metadata for promoted scenario
Change-Id: I1048be7e7a41c56d25c7689678d3811f0a5eae44 Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
Diffstat (limited to 'jjb')
-rw-r--r--jjb/xci/xci-merge-jobs.yml21
-rwxr-xr-xjjb/xci/xci-promote.sh22
2 files changed, 34 insertions, 9 deletions
diff --git a/jjb/xci/xci-merge-jobs.yml b/jjb/xci/xci-merge-jobs.yml
index a7c14ceae..c9788c3d9 100644
--- a/jjb/xci/xci-merge-jobs.yml
+++ b/jjb/xci/xci-merge-jobs.yml
@@ -41,7 +41,7 @@
project-type: multijob
- disabled: '{obj:disabled}'
+ disabled: false
concurrent: false
@@ -167,9 +167,9 @@
project-type: multijob
- disabled: '{obj:disabled}'
+ disabled: false
- concurrent: true
+ concurrent: false
properties:
- logrotate-default
@@ -272,7 +272,7 @@
disabled: false
- concurrent: true
+ concurrent: false
properties:
- logrotate-default
@@ -349,13 +349,19 @@
name: OPNFV_RELENG_DEV_PATH
default: $WORKSPACE/
- string:
+ name: LOCAL_PROMOTION_METADATA_FILE
+ default: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
+ - string:
+ name: REMOTE_PROMOTION_METADATA_FILE
+ default: "gs://artifacts.opnfv.org/xci/pipeline/merge/$DEPLOY_SCENARIO.properties"
+ - string:
name: GIT_BASE
default: https://gerrit.opnfv.org/gerrit/$PROJECT
description: 'Git URL to use on this Jenkins Slave'
wrappers:
- inject:
- properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
+ properties-file: "$LOCAL_PROMOTION_METADATA_FILE"
- ssh-agent-wrapper
- build-timeout:
timeout: 240
@@ -392,6 +398,5 @@
- builder:
name: 'xci-merge-promote-macro'
builders:
- - shell: |
- #!/bin/bash
- echo "Hello World"
+ - shell:
+ !include-raw: ./xci-promote.sh
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!"