From 2b12fd371c4950eb99cda97ccadce7768ae1b78d Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Mon, 26 Nov 2018 21:08:43 +0100 Subject: Web-services-check script constructs URLs based on env. --- buildbot/checks.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'buildbot') diff --git a/buildbot/checks.sh b/buildbot/checks.sh index 4126095..076cfce 100755 --- a/buildbot/checks.sh +++ b/buildbot/checks.sh @@ -2,6 +2,12 @@ active=$(sudo -u test cat /home/test/active) nonactive="blue" + +if test -z ${DEPLOYMENT}; then + echo "Please export env variable DEPLOYMENT=(test|demo) before running this script" + exit 1 +fi + echo "Active party: ${active}" if test $active = "test-blue"; then @@ -22,7 +28,7 @@ error_fmt="%s (http status code: %s)/(curl exit code: %s - %s)\n" http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://exchange.test.taler.net/ -o /dev/null \ + -s https://exchange.${DEPLOYMENT}.taler.net/ -o /dev/null \ -w "%{http_code}") if ! test 200 = $http_status_code; then printf "$error_fmt" \ @@ -33,7 +39,7 @@ fi http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s http://backend.test.taler.net/ \ + -s http://backend.${DEPLOYMENT}.taler.net/ \ --header "Authorization: ApiKey sandbox" \ -o /dev/null \ -w "%{http_code}") @@ -46,7 +52,7 @@ fi http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://shop.test.taler.net/ -o /dev/null \ + -s https://shop.${DEPLOYMENT}.taler.net/ -o /dev/null \ -w "%{http_code}") if ! test 200 = $http_status_code; then printf "$error_fmt" \ @@ -57,7 +63,7 @@ fi http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://donations.test.taler.net/ -o /dev/null \ + -s https://donations.${DEPLOYMENT}.taler.net/ -o /dev/null \ -w "%{http_code}") if ! test 200 = $http_status_code; then printf "$error_fmt" \ @@ -68,7 +74,7 @@ fi http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://bank.test.taler.net/ -o /dev/null \ + -s https://bank.${DEPLOYMENT}.taler.net/ -o /dev/null \ -w "%{http_code}") if ! test 302 = $http_status_code; then printf "$error_fmt" \ @@ -79,7 +85,7 @@ fi http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://test.taler.net/en/index.html -o /dev/null \ + -s https://${DEPLOYMENT}.taler.net/en/index.html -o /dev/null \ -w "%{http_code}") if ! test 200 = $http_status_code; then printf "$error_fmt" \ -- cgit v1.2.3