job "test" { datacenters = ["dc1"] type = "service" constraint { attribute = "${attr.kernel.name}" value = "linux" } group "test" { count = 1 network { port "db" { to = 6379 } } update { health_check = "checks" progress_deadline = "45s" healthy_deadline = "30s" } service { name = "script-check-svc" port = "db" check { name = "tcp" type = "tcp" port = "db" interval = "10s" timeout = "2s" } check { name = "script-check-script" type = "script" command = "/bin/bash" interval = "5s" timeout = "1s" task = "server" on_update = "ignore_warnings" args = [ "-c", "/local/ready.sh" ] check_restart { limit = 2 ignore_warnings = true } } } task "server" { driver = "docker" config { image = "redis" ports = ["db"] } # Check script that reports as warning for long enough for deployment to # become healthy then errors template { data = <