X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fapex%2Fapex-snapshot-deploy.sh;h=bd023f558b048622a32d77c0be40b0c8e6edac95;hb=27d43c8829c848f81251f5c01c50a8bcde941ee8;hp=a93421c8e1e202dfc76c15eea20f6aa3c6a5aea7;hpb=f9a4b3064d986a7a1578417a8349cabd27612d6a;p=releng.git diff --git a/jjb/apex/apex-snapshot-deploy.sh b/jjb/apex/apex-snapshot-deploy.sh index a93421c8e..bd023f558 100644 --- a/jjb/apex/apex-snapshot-deploy.sh +++ b/jjb/apex/apex-snapshot-deploy.sh @@ -25,20 +25,26 @@ pushd ci > /dev/null sudo opnfv-clean popd > /dev/null +full_snap_url="gs://${GS_URL}/${OS_VERSION}/${TOPOLOGY}" + 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 ! 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}/${TOPOLOGY} # check snap cache directory exists # if snapshot cache exists, find the checksum @@ -46,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} @@ -61,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} @@ -141,22 +148,23 @@ done mkdir -p $HOME/cloner-info cp -f overcloudrc $HOME/cloner-info/ -admin_controller_ip=$(cat overcloudrc | grep -Eo -m 1 "192.0.2.[0-9]+") +admin_controller_ip=$(cat overcloudrc | grep -Eo -m 1 "192.0.2.[0-9]+" | head -1) netvirt_url="http://${admin_controller_ip}:8081/restconf/operational/network-topology:network-topology/topology/netvirt:1" source overcloudrc counter=1 while [ "$counter" -le 10 ]; do - if curl --fail --silent ${admin_controller_ip}:80 > /dev/null; then - echo "Overcloud Horizon is up...Checking if OpenDaylight NetVirt is up..." - if curl --fail --silent -u admin:admin ${netvirt_url} > /dev/null; then + 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:${SDN_CONTROLLER_PASSWORD} ${netvirt_url} > /dev/null; then echo "OpenDaylight is up. Overcloud deployment complete" exit 0 else echo "OpenDaylight not yet up, try ${counter}" fi else - echo "Horizon/Apache not yet up, try ${counter}" + echo "Neutron not yet up, try ${counter}" fi counter=$((counter+1)) sleep 60