Update the way wait_for template works
This commit is contained in:
parent
f7189b5a15
commit
c1ce3ccbdb
|
@ -1,3 +1,4 @@
|
|||
|
||||
resources {
|
||||
cpu = [[ .cpu ]]
|
||||
memory = [[ .memory ]]
|
||||
|
@ -5,3 +6,4 @@
|
|||
memory_max = [[ .memory_max ]]
|
||||
[[- end ]]
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
image = [[ .ctx.images.wait_for | toJSON ]]
|
||||
}
|
||||
env {
|
||||
[[- range $k, $v := . ]]
|
||||
[[- if regexp.Match "^SERVICE_\\d+" $k ]]
|
||||
[[ $k ]] = [[ printf "%s%s.service.%s" $v $.ctx.env.suffix $.ctx.consul.domain | toJSON ]]
|
||||
[[- else if regexp.Match "^COUNT_\\d+" $k ]]
|
||||
[[ $k ]] = [[ $v ]]
|
||||
[[- range $idx, $service := .wait_for ]]
|
||||
SERVICE_[[ $idx ]] = [[ printf "%s%s.service.%s" $service.service $.ctx.env.suffix $.ctx.consul.domain | toJSON ]]
|
||||
[[- if has $service "count" ]]
|
||||
COUNT_[[ $idx ]] = [[ $service.count ]]
|
||||
[[- end ]]
|
||||
[[- end ]]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user