Apex: Fix stale GS pulls on artifacts
[releng.git] / jjb / apex / apex-snapshot-deploy.sh
index 9738ecb..bd023f5 100644 (file)
@@ -25,16 +25,19 @@ pushd ci > /dev/null
 sudo opnfv-clean
 popd > /dev/null
 
-full_snap_url=http://$GS_URL/${OS_VERSION}/${TOPOLOGY}
+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
@@ -49,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}
@@ -64,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}
@@ -136,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
@@ -157,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