mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
This update changes the behaviour when following logs from an allocation, so that both stdout and stderr files streamed when the operator supplies the follow flag. The previous behaviour is held when all other flags and situations are provided. Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
36 lines
486 B
HCL
36 lines
486 B
HCL
job "alloc-logs" {
|
|
datacenters = ["dc1"]
|
|
type = "service"
|
|
|
|
#constraint {
|
|
# attribute = "${attr.kernel.name}"
|
|
# value = "linux"
|
|
#}
|
|
|
|
group "alloc-logs" {
|
|
|
|
task "test" {
|
|
driver = "raw_exec"
|
|
|
|
template {
|
|
data = <<EOH
|
|
while true
|
|
do
|
|
echo stdout >&1
|
|
sleep 1
|
|
echo stderr >&2
|
|
sleep 1
|
|
done
|
|
EOH
|
|
|
|
destination = "local/echo.sh"
|
|
}
|
|
|
|
config {
|
|
command = "bash"
|
|
args = ["local/echo.sh"]
|
|
}
|
|
}
|
|
}
|
|
}
|