jenkins module: Check for 200 & 403 response codes

The new jenkins version shows a setup wizard on first startup that will
throw a 403 HTTP response code instead of 200.
This commit is contained in:
Franz Pletz 2016-05-12 03:22:39 +02:00
parent 4a3a92d5c8
commit 939c80c26f

View File

@ -161,8 +161,8 @@ in {
'';
postStart = ''
until ${pkgs.curl.bin}/bin/curl -s -L --fail --head http://${cfg.listenAddress}:${toString cfg.port}${cfg.prefix} >/dev/null; do
sleep 2
until [[ $(${pkgs.curl.bin}/bin/curl -s --head -w '\n%{http_code}' http://${cfg.listenAddress}:${toString cfg.port}${cfg.prefix} | tail -n1) =~ ^(200|403)$ ]]; do
sleep 1
done
'';