-
Notifications
You must be signed in to change notification settings - Fork 4
/
job-template.hcl
119 lines (98 loc) · 2.29 KB
/
job-template.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
job "${DRONE_REPO_OWNER}-${DRONE_REPO_NAME}" {
datacenters = ["dc1"]
type = "service"
namespace = "${PLUGIN_NAMESPACE}"
update {
max_parallel = 1
min_healthy_time = "10s"
healthy_deadline = "3m"
auto_revert = true
auto_promote = true
canary = 1
}
reschedule {
attempts = 15
interval = "1h"
delay = "15s"
delay_function = "exponential"
max_delay = "120s"
unlimited = false
}
group "service" {
restart {
attempts = 5
interval = "3m"
delay = "6s"
mode = "fail"
}
scaling {
enabled = true
min = 1
max = 5
policy {
}
}
meta {
COMMIT_SHA = "${DRONE_COMMIT_SHA}"
}
task "service" {
driver = "docker"
config {
image = "hub.service.consul:5000/openjdk:jdk8"
command = "java"
args = [
"-Dmicronaut.environments=sit",
"-jar","local/jalorx-app.jar"
]
port_map {
http = 8080
}
}
artifact {
source = "http://art.service.consul:2103/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}.tar.gz"
}
service {
name = "${DRONE_REPO_NAME}"
tags = [
"loki",
"lba.enable=true",
"lba.weight=100",
"lba.http.routers.${DRONE_REPO_NAME}.entrypoints=http",
]
canary_tags = [
"canary",
"lba.enable=true",
"lba.weight=1",
"lba.http.routers.${DRONE_REPO_NAME}.entrypoints=http",
]
meta {
alloc_id="${NOMAD_ALLOC_ID}"
app_code="${meta.app_code}"
env="${meta.env}"
}
address_mode = "host"
port = "http"
check {
type = "http"
port = "http"
path = "/services/info"
interval = "12s"
timeout = "6s"
initial_status = "warning"
check_restart {
limit = 3
grace = "40s"
ignore_warnings = true
}
}
}
resources {
cpu = 200
memory = 512
network {
port "http" {}
}
}
}
}
}