summaryrefslogtreecommitdiffstats
path: root/jjb/apex/apex-snapshot-deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/apex/apex-snapshot-deploy.sh')
-rw-r--r--jjb/apex/apex-snapshot-deploy.sh40
1 files changed, 10 insertions, 30 deletions
diff --git a/jjb/apex/apex-snapshot-deploy.sh b/jjb/apex/apex-snapshot-deploy.sh
index 0a475062c..bd023f558 100644
--- a/jjb/apex/apex-snapshot-deploy.sh
+++ b/jjb/apex/apex-snapshot-deploy.sh
@@ -25,43 +25,26 @@ 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}
+full_snap_url="gs://${GS_URL}/${OS_VERSION}/${TOPOLOGY}"
echo "Downloading latest snapshot properties file"
-if ! wget -O $WORKSPACE/opnfv.properties ${full_snap_url}/snapshot.properties; then
+if ! gsutil cp ${full_snap_url}/snapshot.properties $WORKSPACE/opnfv.properties; then
echo "ERROR: Unable to find snapshot.properties at ${full_snap_url}...exiting"
exit 1
fi
+echo "Properties contents:"
+cat ${WORKSPACE}/opnfv.properties
+
# find latest check sum
-latest_snap_checksum=$(cat opnfv.properties | grep OPNFV_SNAP_SHA512SUM | awk -F "=" '{print $2}')
+latest_snap_checksum=$(cat ${WORKSPACE}/opnfv.properties | grep OPNFV_SNAP_SHA512SUM | awk -F "=" '{print $2}')
if [ -z "$latest_snap_checksum" ]; then
echo "ERROR: checksum of latest snapshot from snapshot.properties is null!"
exit 1
fi
local_snap_checksum=""
-SNAP_CACHE=${SNAP_CACHE}/${os_version}/${topo}
+SNAP_CACHE=${SNAP_CACHE}/${OS_VERSION}/${TOPOLOGY}
# check snap cache directory exists
# if snapshot cache exists, find the checksum
@@ -69,6 +52,7 @@ if [ -d "$SNAP_CACHE" ]; then
latest_snap=$(ls ${SNAP_CACHE} | grep tar.gz | tail -n 1)
if [ -n "$latest_snap" ]; then
local_snap_checksum=$(sha512sum ${SNAP_CACHE}/${latest_snap} | cut -d' ' -f1)
+ echo "Local snap checksum is: ${local_snap_checksum}"
fi
else
mkdir -p ${SNAP_CACHE}
@@ -84,7 +68,7 @@ if [ "$local_snap_checksum" != "$latest_snap_checksum" ]; then
echo "INFO: SHA mismatch, will download latest snapshot"
# wipe cache
rm -rf ${SNAP_CACHE}/*
- wget --directory-prefix=${SNAP_CACHE}/ ${snap_url}
+ gsutil cp "gs://${snap_url}" ${SNAP_CACHE}/
snap_tar=$(basename ${snap_url})
else
snap_tar=${latest_snap}
@@ -156,10 +140,6 @@ for node_def in ${virsh_vm_defs}; do
sudo virsh define ${node_def}
node=$(echo ${node_def} | awk -F '.' '{print $1}')
sudo cp -f ${node}.qcow2 /var/lib/libvirt/images/
- # FIXME (trozet) install java on each disk image as required to upgrade ODL
- # should be added to Apex as part of the deployment. Remove this after that
- # is complete
- sudo LIBGUESTFS_BACKEND=direct virt-customize --install java-1.8.0-openjdk -a /var/lib/libvirt/images/${node}.qcow2
sudo virsh start ${node}
echo "Node: ${node} started"
done
@@ -177,7 +157,7 @@ while [ "$counter" -le 10 ]; do
echo "Checking if OpenStack is up"
if nc -z ${admin_controller_ip} 9696 > /dev/null; then
echo "Overcloud Neutron is up...Checking if OpenDaylight NetVirt is up..."
- if curl --fail --silent -u admin:admin ${netvirt_url} > /dev/null; then
+ if curl --fail --silent -u admin:${SDN_CONTROLLER_PASSWORD} ${netvirt_url} > /dev/null; then
echo "OpenDaylight is up. Overcloud deployment complete"
exit 0
else