diff --git a/nomad/service.nomad b/nomad/service.nomad index c589eba..5e3d07c 100644 --- a/nomad/service.nomad +++ b/nomad/service.nomad @@ -25,17 +25,17 @@ job "[[.name]]" { type = "service" group "[[.name]]" { - [[ with .count ]]count = [[ . ]][[end]] + [[ with .count ]]count = [[ . ]][[ end ]] network { mode = "bridge" - [[ if not (empty .service_port) ]] + [[ if not (empty .service_port) -]] port "main" { - [[ if default false .ingress ]] + [[ if default false .ingress -]] host_network = "loopback" - [[ end ]] - to = [[.service_port]] + [[ end -]] + to = [[ .service_port ]] } - [[ end ]] + [[ end -]] } [[ if default false .sticky_disk ]] @@ -54,19 +54,19 @@ job "[[.name]]" { connect { sidecar_service { proxy { - local_service_port = [[.service_port]] - [[ if default false .mysql ]] + local_service_port = [[ .service_port ]] + [[ if default false .mysql -]] upstreams { destination_name = "mysql-server" local_bind_port = 4040 } [[ end -]] - [[ if default false .redis ]] + [[ if default false .redis -]] upstreams { destination_name = "redis" local_bind_port = 6379 } - [[ end ]] + [[ end -]] } } @@ -97,7 +97,7 @@ job "[[.name]]" { [[ end -]] ] } - [[ end ]] + [[ end -]] task "[[.name]]" { driver = "docker" @@ -106,20 +106,20 @@ job "[[.name]]" { image = "[[.image]]" [[ if not (empty .service_port) -]] ports = ["main"] - [[- end ]] + [[ end -]] [[ if not (empty .args) -]] args = ["[[ .args | parseJSON | join `", "` ]]"] - [[- end ]] + [[ end -]] - [[ with .templates]] - [[ range $t := . | parseJSON ]] + [[ with .templates -]] + [[ range $t := . | parseJSON -]] mount { type = "bind" target = "[[ $t.dest ]]" source = "local/[[ $t.dest ]]" } [[ end ]] - [[ end ]] + [[ end -]] } [[ if default false .vault -]] @@ -133,14 +133,14 @@ job "[[.name]]" { [[ with .env -]] env = { - [[- range $k, $v := . ]] + [[ range $k, $v := . -]] "[[$k]]" = "[[$v]]" - [[- end ]] + [[ end -]] } - [[ end ]] + [[ end -]] - [[ with .templates ]] - [[ range $t := . | parseJSON ]] + [[ with .templates -]] + [[ range $t := . | parseJSON -]] template { data = <