common/templates/group_start

34 lines
949 B
Plaintext

[[- if has . "count" ]]
count = [[ .count ]]
[[- end ]]
shutdown_delay = "6s"
[[ template "common/constraints" . ]]
[[- if has .nomad "update" ]]
update {
[[- range $key := coll.Slice "max_parallel" "health_check" "min_healthy_time" "healthy_deadline" "progress_deadline" "auto_revert" "auto_promote" "canary" "stagger" ]]
[[- if has $.nomad.update $key ]]
[[- if or (test.IsKind "bool" (index $.nomad.update $key)) (test.IsKind "number" (index $.nomad.update $key)) ]]
[[ $key ]] = [[ index $.nomad.update $key ]]
[[- else ]]
[[ $key ]] = [[ index $.nomad.update $key | toJSON ]]
[[- end ]]
[[- end ]]
[[- end ]]
}
[[- end ]]
ephemeral_disk {
# Use minimal ephemeral disk
size = 101
}
[[- if and (has . "image") (regexp.Match "SNAPSHOT" .image) ]]
meta {
# Force job to run each time as we're running a snapshot version
run = "${uuidv4()}"
}
[[- end ]]