-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
templater: fail rendering if a variable is not set
previously the default behaviour of text/template was used which would print the string "<no value>", this could lead to a situation where an job file appears valid but would fail to run
- Loading branch information
Peter McAtominey
committed
Oct 5, 2017
1 parent
97a37ae
commit fa4a8c4
Showing
3 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
job "[[.job_name]]" { | ||
datacenters = ["dc1"] | ||
type = "service" | ||
update { | ||
max_parallel = 1 | ||
min_healthy_time = "10s" | ||
healthy_deadline = "1m" | ||
auto_revert = true | ||
} | ||
|
||
group "cache" { | ||
count = 1 | ||
restart { | ||
attempts = 10 | ||
interval = "5m" | ||
delay = "25s" | ||
mode = "delay" | ||
} | ||
ephemeral_disk { | ||
size = 300 | ||
} | ||
task "redis" { | ||
artifact { | ||
# .binary_url is not set | ||
source = "[[ .binary_url ]]" | ||
} | ||
|
||
driver = "docker" | ||
config { | ||
image = "redis:3.2" | ||
port_map { | ||
db = 6379 | ||
} | ||
} | ||
resources { | ||
cpu = 500 | ||
memory = 256 | ||
network { | ||
mbits = 10 | ||
port "db" {} | ||
} | ||
} | ||
service { | ||
name = "global-redis-check" | ||
tags = ["global", "cache"] | ||
port = "db" | ||
check { | ||
name = "alive" | ||
type = "tcp" | ||
interval = "10s" | ||
timeout = "2s" | ||
} | ||
} | ||
} | ||
} | ||
} |