-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbulletspec.schema.json
More file actions
299 lines (299 loc) · 8.62 KB
/
bulletspec.schema.json
File metadata and controls
299 lines (299 loc) · 8.62 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/FurqanSoftware/bullet/bulletspec.schema.json",
"title": "Bulletspec",
"description": "Configuration file for the Bullet deployment tool.",
"type": "object",
"required": ["application"],
"additionalProperties": false,
"properties": {
"application": {
"type": "object",
"required": ["identifier"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Display name of the application."
},
"identifier": {
"type": "string",
"description": "Unique identifier. Used in file paths, container names, and image names."
},
"deploy": {
"$ref": "#/$defs/deploy"
},
"programs": {
"type": "object",
"description": "Named programs to run as containers.",
"additionalProperties": {
"$ref": "#/$defs/program"
}
},
"cron": {
"$ref": "#/$defs/cron"
}
}
}
},
"$defs": {
"deploy": {
"type": "object",
"description": "Deployment behavior configuration.",
"additionalProperties": false,
"properties": {
"current": {
"type": "string",
"enum": ["symlink", "replace"],
"default": "symlink",
"description": "How releases are made current. \"symlink\" creates a symlink, \"replace\" copies contents."
}
}
},
"program": {
"type": "object",
"description": "A long-running service within the application.",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Display name of the program."
},
"command": {
"type": "string",
"description": "Command to run inside the container. Supports variable expansion."
},
"user": {
"type": "string",
"description": "User to run the container as."
},
"container": {
"$ref": "#/$defs/container"
},
"ports": {
"type": "array",
"description": "Port mappings in HOST:CONTAINER format. Host port is incremented per instance.",
"items": {
"type": "string",
"pattern": "^\\d+:\\d+$"
}
},
"volumes": {
"type": "array",
"description": "Volume mounts passed directly to Docker.",
"items": {
"type": "string"
}
},
"healthcheck": {
"$ref": "#/$defs/program_healthcheck"
},
"scales": {
"type": "array",
"description": "Expression-based scaling rules.",
"items": {
"$ref": "#/$defs/scale"
}
},
"reload": {
"$ref": "#/$defs/reload"
},
"unsafe": {
"$ref": "#/$defs/unsafe"
}
}
},
"container": {
"type": "object",
"description": "Docker image or build configuration for a program.",
"additionalProperties": false,
"anyOf": [
{ "required": ["image"] },
{ "required": ["dockerfile"] }
],
"properties": {
"image": {
"type": "string",
"description": "Base Docker image (e.g. node:20-alpine)."
},
"dockerfile": {
"type": "string",
"description": "Path to a Dockerfile. If set, the image is built from this file."
},
"entrypoint": {
"type": "string",
"description": "Custom entrypoint for the container."
},
"working_dir": {
"type": "string",
"description": "Working directory inside the container. Defaults to /<identifier>."
},
"application_dir": {
"type": "string",
"description": "Where the application directory is mounted inside the container. Defaults to /<identifier>."
}
}
},
"program_healthcheck": {
"type": "object",
"description": "Docker's built-in health check configuration.",
"required": ["command"],
"additionalProperties": false,
"properties": {
"command": {
"type": "string",
"description": "Health check command to run inside the container."
},
"interval": {
"type": "string",
"description": "How often to run the check (e.g. 30s, 1m)."
},
"timeout": {
"type": "string",
"description": "Maximum time for a single check (e.g. 5s)."
},
"retries": {
"type": "integer",
"minimum": 0,
"description": "Number of consecutive failures needed to mark unhealthy."
},
"start_period": {
"type": "string",
"description": "Grace period after container start (e.g. 10s)."
}
}
},
"scale": {
"type": "object",
"description": "A conditional scaling rule.",
"required": ["n"],
"additionalProperties": false,
"properties": {
"if": {
"type": "string",
"description": "Boolean expression. If omitted, the rule always applies."
},
"n": {
"type": ["string", "integer"],
"description": "Instance count as a number, or an expression that evaluates to the desired count."
}
}
},
"reload": {
"type": "object",
"description": "How containers are reloaded on deploy.",
"additionalProperties": false,
"properties": {
"method": {
"type": "string",
"enum": ["signal", "command", "restart"],
"default": "restart",
"description": "Reload strategy."
},
"signal": {
"type": "string",
"description": "Signal to send when method is \"signal\" (e.g. SIGHUP)."
},
"command": {
"type": "string",
"description": "Command to exec in container when method is \"command\"."
},
"pre_command": {
"type": "string",
"description": "Command to exec in container before the reload action."
}
},
"allOf": [
{
"if": {
"properties": { "method": { "const": "signal" } },
"required": ["method"]
},
"then": {
"required": ["signal"]
}
},
{
"if": {
"properties": { "method": { "const": "command" } },
"required": ["method"]
},
"then": {
"required": ["command"]
}
}
]
},
"unsafe": {
"type": "object",
"description": "Unsafe container options.",
"additionalProperties": false,
"properties": {
"network_host": {
"type": "boolean",
"default": false,
"description": "Run container with --network=host."
},
"ulimits": {
"type": "array",
"description": "Set container ulimits via --ulimit (e.g. nofile=65535:65535).",
"items": {
"type": "string"
}
}
}
},
"cron": {
"type": "object",
"description": "Scheduled jobs configuration.",
"additionalProperties": false,
"properties": {
"jobs": {
"type": "array",
"description": "List of cron jobs.",
"items": {
"$ref": "#/$defs/job"
}
}
}
},
"job": {
"type": "object",
"description": "A scheduled cron job.",
"required": ["key", "command", "schedule"],
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"description": "Unique identifier for the job."
},
"command": {
"type": "string",
"description": "Command to run in the container."
},
"schedule": {
"type": "string",
"description": "systemd OnCalendar expression (e.g. daily, hourly, *-*-* 02:00:00)."
},
"jitter": {
"type": "string",
"description": "Random delay added to the schedule (e.g. 30m)."
},
"healthcheck": {
"$ref": "#/$defs/job_healthcheck"
}
}
},
"job_healthcheck": {
"type": "object",
"description": "Health check pings for a cron job.",
"additionalProperties": false,
"properties": {
"url": {
"type": "string",
"description": "Base URL for health pings. Bullet calls {url}/start before the job and {url}/{exit_status} after."
}
}
}
}
}