X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;f=jjb%2Fnolabs%2Fhandle-booking.sh;fp=jjb%2Fnolabs%2Fhandle-booking.sh;h=b6b9066b1bbff5239446c82126024c7cb2227c14;hb=c4e45493866a5c5d1f780506446c4f63b0c15ea1;hp=15630106886da698d66035deafb36a7ef9c0b88a;hpb=4845071790c218146ad91a1149fd9f98758d50a5;p=infra%2Fcicd.git diff --git a/jjb/nolabs/handle-booking.sh b/jjb/nolabs/handle-booking.sh index 15630106..b6b9066b 100644 --- a/jjb/nolabs/handle-booking.sh +++ b/jjb/nolabs/handle-booking.sh @@ -10,7 +10,7 @@ source $NOLABS_VENV/bin/activate > /dev/null pip install httpie > /dev/null # check if the booking is cancelled or not -echo "API Request: http --ignore-stdin GET $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID | jq -r '.status_text" +echo "API Request: http --ignore-stdin GET $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID | jq -r '.status_text'" BOOKING_STATUS=$(http --ignore-stdin GET $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID | jq -r '.status_text') if [[ $BOOKING_STATUS != 'new' ]]; then echo "Info: Booking is either cancelled or not valid! Exiting!" @@ -18,12 +18,12 @@ if [[ $BOOKING_STATUS != 'new' ]]; then fi # get authentication token -echo "API Request: http --ignore-stdin POST http://188.212.108.245/api/tokens --auth dummy@dummy.com:dummy | jq -r '.token'" -NOLABS_TOKEN=$(http --ignore-stdin POST http://188.212.108.245/api/tokens --auth $NOLABS_API_USERNAME:$NOLABS_API_PASSWORD | jq -r '.token') +echo "API Request: http --ignore-stdin POST $NOLABS_API_TOKENS_ENDPOINT --auth dummy@dummy.com:dummy | jq -r '.token'" +NOLABS_TOKEN=$(http --ignore-stdin POST $NOLABS_API_TOKENS_ENDPOINT --auth $NOLABS_API_USERNAME:$NOLABS_API_PASSWORD | jq -r '.token') echo "API Request: http --ignore-stdin PUT $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID \"status_text=deploying\" \"Authorization:Bearer DUMMY_TOKEN\"" http --ignore-stdin PUT $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID "status_text=deploying" \ - "Authorization:Bearer $NOLABS_TOKEN" - + "Authorization:Bearer $NOLABS_TOKEN" + # get ssh public key of the user echo "API Request: http GET $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID | jq -r '.user_id'" NOLABS_USER_ID=$(http GET $NOLABS_API_BOOKINGS_ENDPOINT/$BOOKING_ID | jq -r '.user_id')