diff options
Diffstat (limited to 'jjb/apex/apex-snapshot-deploy.sh')
-rw-r--r-- | jjb/apex/apex-snapshot-deploy.sh | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/jjb/apex/apex-snapshot-deploy.sh b/jjb/apex/apex-snapshot-deploy.sh index 3bb65a0b3..773edd228 100644 --- a/jjb/apex/apex-snapshot-deploy.sh +++ b/jjb/apex/apex-snapshot-deploy.sh @@ -21,8 +21,7 @@ echo "--------------------------" echo echo "Cleaning server" -git clone https://gerrit.opnfv.org/gerrit/apex.git -pushd apex/ci > /dev/null +pushd ci > /dev/null sudo CONFIG=../build/ LIB=../lib ./clean.sh popd > /dev/null @@ -42,23 +41,26 @@ fi local_snap_checksum="" # check snap cache directory exists +# if snapshot cache exists, find the checksum if [ -d "$SNAP_CACHE" ]; then - latest_snap=$(ls -Art | grep tar.gz | tail -n 1) + latest_snap=$(ls ${SNAP_CACHE} | grep tar.gz | tail -n 1) if [ -n "$latest_snap" ]; then - local_snap_checksum=$(sha512sum ${latest_snap} | cut -d' ' -f1) + local_snap_checksum=$(sha512sum ${SNAP_CACHE}/${latest_snap} | cut -d' ' -f1) fi else mkdir -p ${SNAP_CACHE} fi # compare check sum and download latest snap if not up to date -if [ "$local_snap_checksum" -ne "$latest_snap_checksum" ]; then +if [ "$local_snap_checksum" != "$latest_snap_checksum" ]; then snap_url=$(cat opnfv.properties | grep OPNFV_SNAP_URL | awk -F "=" '{print $2}') if [ -z "$snap_url" ]; then echo "ERROR: Snap URL from snapshot.properties is null!" exit 1 fi echo "INFO: SHA mismatch, will download latest snapshot" + # wipe cache + rm -rf ${SNAP_CACHE}/* wget --directory-prefix=${SNAP_CACHE}/ ${snap_url} snap_tar=$(basename ${snap_url}) else @@ -67,9 +69,8 @@ fi echo "INFO: Snapshot to be used is ${snap_tar}" -# create tmp directory and unpack snap -mkdir -p ./tmp -pushd ./tmp > /dev/null +# move to snap cache dir and unpack +pushd ${SNAP_CACHE} > /dev/null tar xvf ${snap_tar} # create each network @@ -87,8 +88,8 @@ for network_def in ${virsh_networks}; do sudo virsh net-start ${network} fi echo "Checking if OVS bridge is missing for network: ${network}" - if ! ovs-vsctl show | grep "br-${network}"; then - ovs-vsctl add-br br-${network} + if ! sudo ovs-vsctl show | grep "br-${network}"; then + sudo ovs-vsctl add-br br-${network} echo "OVS Bridge created: br-${network}" if [ "br-${network}" == 'br-admin' ]; then echo "Configuring IP 192.0.2.99 on br-admin" @@ -102,7 +103,7 @@ for network_def in ${virsh_networks}; do fi done -echo "Virsh networks up: $(virsh net-list)" +echo "Virsh networks up: $(sudo virsh net-list)" echo "Bringing up Overcloud VMs..." virsh_vm_defs=$(ls baremetal*.xml) @@ -135,9 +136,9 @@ netvirt_url="http://${admin_controller_ip}:8081/restconf/operational/network-top source overcloudrc counter=1 while [ "$counter" -le 10 ]; do - if curl --fail ${admin_controller_ip}:80; then + 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 ${netvirt_url} > /dev/null; then + if curl --fail --silent -u admin:admin ${netvirt_url} > /dev/null; then echo "OpenDaylight is up. Overcloud deployment complete" exit 0 else |