2020-11-18 18:43:48 +00:00
|
|
|
job "template-paths" {
|
|
|
|
datacenters = ["dc1", "dc2"]
|
|
|
|
|
2021-01-04 22:00:55 +00:00
|
|
|
meta {
|
|
|
|
ARTIFACT_DEST_DIR = "local/foo/src"
|
|
|
|
}
|
|
|
|
|
2020-11-18 18:43:48 +00:00
|
|
|
constraint {
|
|
|
|
attribute = "${attr.kernel.name}"
|
|
|
|
value = "linux"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "template-paths" {
|
|
|
|
|
|
|
|
task "task" {
|
|
|
|
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "busybox:1"
|
|
|
|
command = "/bin/sh"
|
|
|
|
args = ["-c", "sleep 300"]
|
|
|
|
}
|
|
|
|
|
|
|
|
artifact {
|
|
|
|
source = "https://google.com"
|
2021-01-04 22:00:55 +00:00
|
|
|
destination = "${NOMAD_META_ARTIFACT_DEST_DIR}"
|
2020-11-18 18:43:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
source = "${NOMAD_TASK_DIR}/foo/src"
|
|
|
|
destination = "${NOMAD_SECRETS_DIR}/foo/dst"
|
|
|
|
}
|
|
|
|
|
2020-12-14 17:56:34 +00:00
|
|
|
template {
|
|
|
|
destination = "${NOMAD_ALLOC_DIR}/shared.txt"
|
|
|
|
data = <<EOH
|
|
|
|
Data shared between all task in alloc dir.
|
|
|
|
EOH
|
|
|
|
}
|
|
|
|
|
2020-11-18 18:43:48 +00:00
|
|
|
resources {
|
|
|
|
cpu = 128
|
|
|
|
memory = 64
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|