# lifecycle hook test job for service jobs. touches, removes, and tests # for the existence of files to assert the order of running tasks. # after stopping, the alloc dir should contain the following files: # files: ./init-ran, ./sidecar-ran, ./main-ran, ./poststart-run but not # the ./main-running, ./sidecar-running, or ./poststart-running files job "service-lifecycle" { datacenters = ["dc1"] type = "service" constraint { attribute = "${attr.kernel.name}" value = "linux" } group "test" { task "init" { lifecycle { hook = "prestart" } driver = "docker" config { image = "busybox:1" command = "/bin/sh" args = ["local/prestart.sh"] } template { data = <