/
builder.tmpl
42 lines (41 loc) · 1014 Bytes
/
builder.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
job "[[$.job_id]]" {
name = "[[$.job_name]]"
datacenters = ["dc1"]
type = "batch"
[[ range $name, $file := $.fragments ]]
group "[[ $name ]]" {
[[ fileContents $file ]]
count = 0
task "engage" {
lifecycle {
hook = "poststop"
}
driver = "docker"
config {
image = "cgbaker/nomad-dag-hack"
args = [ [[ with $next := get $.graph $name ]]
[[ range $i, $n := $next ]][[if $i]],[[end]]"[[$n]]"[[ end ]]
[[ end ]] ]
}
env {
NOMAD_ADDR = "[[ env "NOMAD_ADDR" ]]"
}
}
}
[[ end ]]
group "🚀" {
count = 1
task "engage" {
driver = "docker"
config {
image = "cgbaker/nomad-dag-hack"
args = [ [[ with $next := get $.graph "" ]]
[[ range $i, $n := $next ]][[if $i]],[[end]]"[[$n]]"[[ end ]]
[[ end ]] ]
}
env {
NOMAD_ADDR = "[[ env "NOMAD_ADDR" ]]"
}
}
}
}