-
Notifications
You must be signed in to change notification settings - Fork 0
/
job.nomad.hcl
70 lines (58 loc) · 1.47 KB
/
job.nomad.hcl
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
variable "version" {
type = string
}
variable "b2_access_key_id" {
type = string
}
variable "b2_secret_access_key" {
type = string
}
job "garbage_speak" {
datacenters = ["dc1"]
namespace = "default"
group "task" {
count = 2
network {
port "garbage_speak" {
to = 1314
host_network = "private"
}
}
task "garbage_speak" {
driver = "exec"
config {
command = "garbage-speak-${var.version}"
}
artifact {
source = "s3://s3.us-east-005.backblazeb2.com/garbage-speak-application/garbage-speak-${var.version}"
options {
aws_access_key_id = var.b2_access_key_id
aws_access_key_secret = var.b2_secret_access_key
}
}
template {
data = <<EOF
{{ with nomadVar "nomad/jobs/garbage_speak" }}POSTGRES_URL=postgresql://{{ .POSTGRES_USER }}:{{ .POSTGRES_PASSWORD }}{{end}}@{{ range nomadService "postgres" }}{{ .Address }}:{{ .Port }}{{ end }}/garbage_speak?sslmode=disable
{{ with nomadVar "nomad/jobs/garbage_speak" }}SMTP_PASSWORD={{ .SMTP_PASSWORD }}
SMTP_USERNAME={{ .SMTP_USERNAME }}
SMTP_HOST={{ .SMTP_HOST }}{{ end }}
GO_ENV=production
SITE_DOMAIN=garbagespeak.com
EOF
destination = "local/env"
env = true
}
env {
}
resources {
cpu = 1024
memory = 1024
}
service {
port = "garbage_speak"
name = "garbage-speak"
provider = "nomad"
}
}
}
}