X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;f=jjb%2Fnolabs%2Fhandle-booking.sh;h=fa37ee2696769a278b005d1aa6c3eb87f2d5b1e8;hb=fc0bd715212a172c15c143142f44af1fc029f9f2;hp=e0096a959ef3a877429bd650403544add3900a3c;hpb=346bfa8a910763ed0260da217933853a7bcec948;p=infra%2Fcicd.git diff --git a/jjb/nolabs/handle-booking.sh b/jjb/nolabs/handle-booking.sh index e0096a95..fa37ee26 100644 --- a/jjb/nolabs/handle-booking.sh +++ b/jjb/nolabs/handle-booking.sh @@ -1,4 +1,7 @@ #!/bin/bash +set -o errexit +set -o nounset +set -o pipefail cd $WORKSPACE @@ -7,7 +10,9 @@ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) sudo apt install -y virtualenv jq > /dev/null /bin/rm -rf $NOLABS_VENV && mkdir -p $NOLABS_VENV virtualenv -p python3 $NOLABS_VENV > /dev/null +set +u source $NOLABS_VENV/bin/activate > /dev/null +set -u pip install httpie > /dev/null # check if the booking is cancelled or not @@ -30,11 +35,10 @@ echo "API Request: http GET $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID | jq -r '. NOLABS_USER_ID=$(http GET $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID | jq -r '.user_id') echo "API Request: http --ignore-stdin GET $NOLABS_API_USERS_ENDPOINT/$NOLABS_USER_ID \"Authorization:Bearer DUMMY_TOKEN\" | jq -r '.ssh_public_key'" http --ignore-stdin GET $NOLABS_API_USERS_ENDPOINT/$NOLABS_USER_ID "Authorization:Bearer $NOLABS_TOKEN" | jq -r '.ssh_public_key' > $NOLABS_USER_SSHPUBKEY -echo "-------------------------------------------------" -cat $NOLABS_USER_SSHPUBKEY -echo "-------------------------------------------------" +set +u deactivate +set -u # get the specific patch cd $WORKSPACE git fetch "https://gerrit.nordix.org/infra/engine" $GERRIT_REFSPEC && git checkout FETCH_HEAD @@ -46,7 +50,9 @@ cd engine cd $WORKSPACE +set +u source $NOLABS_VENV/bin/activate > /dev/null +set -u ENGINE_VERSION=$(git rev-parse HEAD) cd $WORKSPACE/.cache/repos/swconfig SCENARIO_VERSION=$(git rev-parse HEAD)