diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-01-09 16:05:25 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-01-09 16:05:25 +0100 |
commit | cd9bee6b524245634c89fb003504ed4d51046754 (patch) | |
tree | d989273024c6bdf5c6167e943078241208e46efe /buildbot | |
parent | ca4dc82767029ad1f47752ce54bcc4b4f6030c37 (diff) | |
download | deployment-cd9bee6b524245634c89fb003504ed4d51046754.tar.gz deployment-cd9bee6b524245634c89fb003504ed4d51046754.tar.bz2 deployment-cd9bee6b524245634c89fb003504ed4d51046754.zip |
more diagnostics from failed-to-restart services
Diffstat (limited to 'buildbot')
-rwxr-xr-x | buildbot/checks.sh | 73 |
1 files changed, 51 insertions, 22 deletions
diff --git a/buildbot/checks.sh b/buildbot/checks.sh index 39f52b6..779d845 100755 --- a/buildbot/checks.sh +++ b/buildbot/checks.sh @@ -8,50 +8,79 @@ if test $active = "test-blue"; then nonactive="green" fi -if ! test 200 = $(curl \ +error_stringify () +{ + case $1 in + 28) echo "connection timed out" ;; + 7) echo "failed to connect to host" ;; + *) echo "unknown, see curl man page" ;; + esac +} + +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 \ - -w "%{http_code}"); then - echo Exchange did not restart correctly + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf "%s (http status code: %s)/(curl exit code: %s - %s)\n" \ + "Exchange did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 200 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ -s http://backend.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Merchant backend did not restart correctly + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf $error_fmt \ + "Merchant backend did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 200 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://shop.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Blog did not restart correctly + -s http://shop.test.taler.net/ -o /dev/null \ + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf $error_fmt \ + "Blog did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 200 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://donations.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Donations shop did not restart correctly + -s http://donations.test.taler.net/ -o /dev/null \ + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf $error_fmt \ + "Donations shop did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 302 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://bank.test.taler.net/ -o /dev/null \ - -w "%{http_code}"); then - echo Bank did not restart correctly + -s http://bank.test.taler.net/ -o /dev/null \ + -w "%{http_code}") +if ! test 302 = $http_status_code; then + printf $error_fmt \ + "Bank did not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi -if ! test 200 = $(curl \ +http_status_code=$(curl \ -H "X-Taler-Deployment-Color: $nonactive" \ - -s https://test.taler.net/en/index.html -o /dev/null \ - -w "%{http_code}"); then - echo Landing page did not restart correctly + -s http://test.taler.net/ -o /dev/null \ + -w "%{http_code}") +if ! test 200 = $http_status_code; then + printf $error_fmt \ + "Landing page not restart correctly" \ + $http_status_code $? $(error_stringify $?) exit 1 fi |