@certik/skynet 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/deploy.js +3 -44
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/deploy.js
CHANGED
|
@@ -67,7 +67,7 @@ const genConfig = ({
|
|
|
67
67
|
cron
|
|
68
68
|
? `# Triggers periodically
|
|
69
69
|
periodic {
|
|
70
|
-
|
|
70
|
+
crons = ["${cron}"]
|
|
71
71
|
prohibit_overlap = true
|
|
72
72
|
}`
|
|
73
73
|
: ""
|
|
@@ -111,35 +111,6 @@ const genConfig = ({
|
|
|
111
111
|
: ""
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
task "log-shipper" {
|
|
115
|
-
driver = "raw_exec"
|
|
116
|
-
|
|
117
|
-
config {
|
|
118
|
-
command = "sh"
|
|
119
|
-
args = [
|
|
120
|
-
"-c",
|
|
121
|
-
"cd \${meta.skynet_code_path}/infra-nomad/log-shipper && if [ -e bun.lockb ]; then bun install --silent; else yarn install --silent; fi && exec bin/shipper --path ${jobName} --opensearch"
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
env {
|
|
126
|
-
SKYNET_ENVIRONMENT="${isProduction ? "prd" : "dev"}"
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
kill_timeout = "120s"
|
|
130
|
-
|
|
131
|
-
resources {
|
|
132
|
-
cpu = 200 # MHz
|
|
133
|
-
memory = 200 # MB
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
restart {
|
|
137
|
-
attempts = 3
|
|
138
|
-
delay = "15s"
|
|
139
|
-
mode = "fail"
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
114
|
task "main" {
|
|
144
115
|
driver = "raw_exec"
|
|
145
116
|
|
|
@@ -185,8 +156,10 @@ EOH
|
|
|
185
156
|
|
|
186
157
|
# It is possible to set environment variables which will be
|
|
187
158
|
# available to the task when it runs.
|
|
159
|
+
# always update environment so that new deployment always triggers
|
|
188
160
|
env {
|
|
189
161
|
SKYNET_ENVIRONMENT="${isProduction ? "prd" : "dev"}"
|
|
162
|
+
SKYNET_DEPLOYED_AT="${new Date().toISOString()}"
|
|
190
163
|
}
|
|
191
164
|
|
|
192
165
|
kill_timeout = "${killTimeout || "60s"}"
|
|
@@ -387,13 +360,6 @@ function createModeDeploy({
|
|
|
387
360
|
delta: { cpu: deltaCpu, mem: deltaMem, killTimeout: deltaKillTimeout },
|
|
388
361
|
};
|
|
389
362
|
|
|
390
|
-
// added an always changing env var
|
|
391
|
-
// to ensure new deployment always triggers
|
|
392
|
-
env = {
|
|
393
|
-
...env,
|
|
394
|
-
SKYNET_DEPLOYED_AT: new Date().toISOString(),
|
|
395
|
-
};
|
|
396
|
-
|
|
397
363
|
// by default use delta cpu/mem settings
|
|
398
364
|
const { cpu, mem, killTimeout } = modeResouces[mode] || modeResouces.delta;
|
|
399
365
|
|
|
@@ -578,13 +544,6 @@ function createDeploy({
|
|
|
578
544
|
cron = cmdSchedule;
|
|
579
545
|
}
|
|
580
546
|
|
|
581
|
-
// added an always changing env var
|
|
582
|
-
// to ensure new deployment always triggers
|
|
583
|
-
env = {
|
|
584
|
-
...env,
|
|
585
|
-
SKYNET_DEPLOYED_AT: new Date().toISOString(),
|
|
586
|
-
};
|
|
587
|
-
|
|
588
547
|
const nomadJobDefinition = genConfig({
|
|
589
548
|
jobName,
|
|
590
549
|
cron: INTERVAL_ALIASES[cron] || cron,
|