2024-10-02 18:26:57 +00:00
|
|
|
job "${name}-${action_name}" {
|
|
|
|
region = "global"
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
|
|
|
|
type = "batch"
|
|
|
|
|
|
|
|
periodic {
|
|
|
|
cron = "${action_cron}"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "main" {
|
|
|
|
task "${action_name}" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "hashicorp/nomad:$${attr.nomad.version}"
|
|
|
|
args = [
|
|
|
|
"job",
|
|
|
|
"action",
|
|
|
|
"-job",
|
|
|
|
"${name}",
|
|
|
|
"-group",
|
|
|
|
"${name}",
|
|
|
|
"-task",
|
|
|
|
"${name}",
|
|
|
|
"${action_name}"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2024-10-02 19:07:37 +00:00
|
|
|
env = {
|
|
|
|
NOMAD_ADDR = "unix:///secrets/api.sock"
|
|
|
|
}
|
|
|
|
|
2024-10-02 18:26:57 +00:00
|
|
|
identity {
|
|
|
|
env = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|