X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fxci%2Fbifrost-verify.sh;h=03d9afccde2df7c120370969fd3bb7127a82fa7c;hb=97ae2baff7af396ff2a90e7838fe0c50ef2dfce8;hp=f596d75272a6ccf41729d7d7d0789a014f14f883;hpb=5412a1b30129d25b6f7f7de6c5262e2e3edc699b;p=releng.git diff --git a/jjb/xci/bifrost-verify.sh b/jjb/xci/bifrost-verify.sh index f596d7527..03d9afccd 100755 --- a/jjb/xci/bifrost-verify.sh +++ b/jjb/xci/bifrost-verify.sh @@ -57,16 +57,17 @@ EOF EOF + # Upload landing page + echo "Uploading the landing page" + gsutil -q cp ${WORKSPACE}/index.html ${BIFROST_GS_URL}/index.html + rm -f ${WORKSPACE}/index.html + # Finally, download and upload the entire build log so we can retain # as much build information as possible echo "Uploading the final console output" curl -s -L ${BIFROST_CONSOLE_LOG} > ${WORKSPACE}/build_log.txt gsutil -q cp -Z ${WORKSPACE}/build_log.txt ${BIFROST_GS_URL}/build_log.txt - rm ${WORKSPACE}/build_log.txt - - # Upload landing page - gsutil -q cp ${WORKSPACE}/index.html ${BIFROST_GS_URL}/index.html - rm ${WORKSPACE}/index.html + rm -f ${WORKSPACE}/build_log.txt } function fix_ownership() { @@ -83,44 +84,47 @@ function fix_ownership() { function cleanup_and_upload() { original_exit=$? + echo "Job exit code: $original_exit" + # Turn off errexit + set +o errexit fix_ownership upload_logs exit $original_exit } # check distro to see if we support it -if [[ ! "$DISTRO" =~ (trusty|centos7|suse) ]]; then +if [[ ! "$DISTRO" =~ (xenial|centos7|suse) ]]; then echo "Distro $DISTRO is not supported!" exit 1 fi # remove previously cloned repos -sudo /bin/rm -rf /opt/bifrost /opt/releng +/bin/rm -rf $WORKSPACE/bifrost $WORKSPACE/releng-xci # Fix up permissions fix_ownership # clone all the repos first and checkout the patch afterwards -sudo git clone https://git.openstack.org/openstack/bifrost /opt/bifrost -sudo git clone https://gerrit.opnfv.org/gerrit/releng /opt/releng +git clone https://git.openstack.org/openstack/bifrost $WORKSPACE/bifrost +git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE/releng-xci # checkout the patch cd $CLONE_LOCATION -sudo git fetch $PROJECT_REPO $GERRIT_REFSPEC && sudo git checkout FETCH_HEAD +git fetch $PROJECT_REPO $GERRIT_REFSPEC && sudo git checkout FETCH_HEAD # combine opnfv and upstream scripts/playbooks -sudo /bin/cp -rf /opt/releng/prototypes/bifrost/* /opt/bifrost/ +/bin/cp -rf $WORKSPACE/releng-xci/bifrost/* $WORKSPACE/bifrost/ # cleanup remnants of previous deployment -cd /opt/bifrost -sudo -E ./scripts/destroy-env.sh +cd $WORKSPACE/bifrost +sudo -H -E ./scripts/destroy-env.sh # provision 3 VMs; xcimaster, controller, and compute -cd /opt/bifrost -sudo -E ./scripts/bifrost-provision.sh +cd $WORKSPACE/bifrost +./scripts/bifrost-provision.sh # list the provisioned VMs -cd /opt/bifrost +cd $WORKSPACE/bifrost source env-vars ironic node-list -virsh list +sudo -H -E virsh list