summaryrefslogtreecommitdiffstats
path: root/jjb/apex/apex-snapshot-deploy.sh
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-07-12 10:32:40 -0400
committerTim Rozet <trozet@redhat.com>2018-07-12 10:32:40 -0400
commita97b6df03becc572ae29403b6069cc1496517088 (patch)
tree1a6976dca7b779cb8f728abb61d88c9e9cd9f70b /jjb/apex/apex-snapshot-deploy.sh
parentbe49a5c9b7a9e1c5977f16eb84465b367277563f (diff)
Apex: Allow for multi-version snapshots
This patch adds ability to manage multiple snapshot versions. We want to be able to have snapshots for noha and ha for multiple OS releases. This adds that capability and updates the deploy script to be able to deploy them. Also a user can specify which scenario to trigger with his ODL netvirt commit by doing 'opnfv-check <os version>-<ha|noha> Change-Id: I3884b41c86b55c187becfb83ef62f3431724d09e Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'jjb/apex/apex-snapshot-deploy.sh')
-rw-r--r--jjb/apex/apex-snapshot-deploy.sh27
1 files changed, 25 insertions, 2 deletions
diff --git a/jjb/apex/apex-snapshot-deploy.sh b/jjb/apex/apex-snapshot-deploy.sh
index 0760626e3..0a475062c 100644
--- a/jjb/apex/apex-snapshot-deploy.sh
+++ b/jjb/apex/apex-snapshot-deploy.sh
@@ -25,9 +25,31 @@ pushd ci > /dev/null
sudo opnfv-clean
popd > /dev/null
+echo "Detecting requested OpenStack branch and topology type in gerrit comment"
+parsed_comment=$(echo $GERRIT_EVENT_COMMENT_TEXT | sed -n 's/^opnfv-check\s*//p')
+parsed_comment=$(echo $parsed_comment | sed -n 's/\s*$//p')
+if [ ! -z "$parsed_comment" ]; then
+ if echo $parsed_comment | grep -E '^[a-z]+-(no)?ha'; then
+ IFS='-' read -r -a array <<< "$parsed_comment"
+ os_version=${array[0]}
+ topo=${array[1]}
+ echo "OS version detected in gerrit comment: ${os_version}"
+ echo "Topology type detected in gerrit comment: ${topo}"
+ else
+ echo "Invalid format given for scenario in gerrit comment: ${parsed_comment}...aborting"
+ exit 1
+ fi
+else
+ echo "No scenario given in gerrit comment, will use default (master OpenStack, noha)"
+ os_version='master'
+ topo='noha'
+fi
+
+full_snap_url=http://$GS_URL/${os_version}/${topo}
+
echo "Downloading latest snapshot properties file"
-if ! wget -O $WORKSPACE/opnfv.properties http://$GS_URL/snapshot.properties; then
- echo "ERROR: Unable to find snapshot.properties at ${GS_URL}...exiting"
+if ! wget -O $WORKSPACE/opnfv.properties ${full_snap_url}/snapshot.properties; then
+ echo "ERROR: Unable to find snapshot.properties at ${full_snap_url}...exiting"
exit 1
fi
@@ -39,6 +61,7 @@ if [ -z "$latest_snap_checksum" ]; then
fi
local_snap_checksum=""
+SNAP_CACHE=${SNAP_CACHE}/${os_version}/${topo}
# check snap cache directory exists
# if snapshot cache exists, find the checksum