hammerkit 1.4.0-beta.6 → 1.5.0-alpha.0
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/.devcontainer/Dockerfile +5 -0
- package/.devcontainer/devcontainer.json +40 -0
- package/Dockerfile +1 -1
- package/README.md +13 -86
- package/SUMMARY.md +43 -0
- package/build.schema.json +56 -2
- package/dist/cli.js +97 -0
- package/dist/cli.spec.js +5 -0
- package/dist/console/console-context-mock.js +11 -0
- package/dist/console/get-logger.js +23 -0
- package/dist/docker/pull.js +5 -5
- package/dist/docker/remove-container.js +21 -0
- package/dist/docker/stream.js +19 -21
- package/dist/docker/using-container.js +28 -0
- package/dist/environment/get-process-env.js +4 -4
- package/dist/environment/replace-env-variables.js +2 -3
- package/dist/executer/abort.js +13 -0
- package/dist/executer/check-readiness.js +25 -0
- package/dist/executer/create-scheduler-state.js +32 -0
- package/dist/executer/docker-node.js +123 -0
- package/dist/executer/docker-service.js +113 -0
- package/dist/executer/environment-mock.js +17 -0
- package/dist/executer/event-cache.js +165 -0
- package/dist/executer/execute-command.js +42 -0
- package/dist/executer/execute-docker.js +73 -223
- package/dist/executer/execute.spec.js +37 -37
- package/dist/executer/execution-steps.js +57 -0
- package/dist/executer/get-docker-executor.js +21 -20
- package/dist/executer/hierarchy-scheduler.js +94 -0
- package/dist/executer/kubernetes-service.js +64 -0
- package/dist/executer/label-values.js +65 -0
- package/dist/executer/local-node.js +57 -0
- package/dist/executer/print-container-options.js +17 -0
- package/dist/{logging/log-strategy.js → executer/process-item.js} +1 -1
- package/dist/executer/process-listener.js +3 -0
- package/dist/executer/process-manager.js +111 -0
- package/dist/executer/process-manager.spec.js +91 -0
- package/dist/executer/{executor.js → process.js} +1 -1
- package/dist/executer/{execute-result.js → readonly-state.js} +1 -1
- package/dist/executer/schedule.js +139 -0
- package/dist/executer/scheduler/check-for-loop.js +21 -0
- package/dist/executer/scheduler/enqueue-next.js +27 -0
- package/dist/{testing/test-context.js → executer/scheduler/node-state.js} +1 -1
- package/dist/executer/scheduler/scheduler-result.js +3 -0
- package/dist/executer/scheduler/scheduler-state.js +3 -0
- package/dist/executer/scheduler/service-state.js +3 -0
- package/dist/executer/service-dns.js +6 -0
- package/dist/executer/set-user-permission.js +16 -0
- package/dist/executer/start-node.js +59 -0
- package/dist/executer/state-listener.js +3 -0
- package/dist/executer/state.js +49 -0
- package/dist/executer/states.js +4 -129
- package/dist/executer/watch-node.js +57 -0
- package/dist/executer/watch-service.js +54 -0
- package/dist/executer/work-scope.js +10 -0
- package/dist/file/get-file-context-mock.js +1 -0
- package/dist/file/get-file-context-mock.spec.js +28 -27
- package/dist/file/get-file-context.js +73 -63
- package/dist/file/move-files.js +1 -1
- package/dist/get-work-context.js +29 -0
- package/dist/index.js +11 -10
- package/dist/log.js +209 -52
- package/dist/logging/grouped-logger.js +31 -19
- package/dist/logging/interactive-logger.js +20 -23
- package/dist/logging/live-logger.js +7 -17
- package/dist/optimizer/calculate-checksum.js +1 -1
- package/dist/optimizer/get-cache-directory.js +8 -13
- package/dist/optimizer/get-work-node-cache-stats.js +68 -21
- package/dist/optimizer/read-work-node-cache.js +2 -2
- package/dist/optimizer/work-node-cache-description.js +12 -11
- package/dist/optimizer/write-work-node-cache.js +9 -8
- package/dist/{executer/execution-context.js → parser/build-file-service.js} +1 -1
- package/dist/{optimizer → parser}/cache-method.js +0 -0
- package/dist/parser/get-build-file.js +1 -1
- package/dist/parser/parse-boolean.js +29 -0
- package/dist/parser/parse-boolean.spec.js +48 -0
- package/dist/parser/parse-build-file-references.js +2 -2
- package/dist/parser/parse-build-file-services.js +58 -0
- package/dist/parser/parse-build-file-task-command.js +6 -5
- package/dist/parser/parse-build-file-task-source.js +5 -5
- package/dist/parser/parse-build-file.js +29 -17
- package/dist/parser/parse-context.js +13 -0
- package/dist/parser/parse-envs.js +4 -3
- package/dist/parser/parse-healthcheck.js +28 -0
- package/dist/parser/parse-label-arguments.js +23 -0
- package/dist/parser/parse-service-selector.js +39 -0
- package/dist/parser/parse-string-array.js +6 -5
- package/dist/parser/parse-string-map.js +30 -0
- package/dist/parser/parse-string.js +20 -0
- package/dist/parser/read-build-file.js +16 -5
- package/dist/parser/read-env-file.js +7 -7
- package/dist/planner/utils/get-container-mounts.js +24 -0
- package/dist/planner/utils/normalize-path.js +17 -0
- package/dist/planner/utils/parse-work-node-mount.js +3 -14
- package/dist/planner/utils/parse-work-node-mount.spec.js +10 -10
- package/dist/planner/utils/parse-work-service-volume.js +21 -0
- package/dist/planner/utils/plan-work-command.js +1 -1
- package/dist/planner/utils/plan-work-dependency.js +29 -24
- package/dist/planner/utils/plan-work-node.js +203 -120
- package/dist/planner/utils/plan-work-nodes.js +60 -12
- package/dist/planner/utils/plan-work-tree.js +8 -4
- package/dist/planner/utils/plan-work-volume.js +25 -0
- package/dist/planner/validate.js +56 -8
- package/dist/planner/work-context.js +20 -0
- package/dist/planner/work-mount.js +3 -0
- package/dist/planner/work-node-id.js +4 -4
- package/dist/planner/work-node-id.spec.js +11 -8
- package/dist/planner/work-node-path.js +0 -1
- package/dist/planner/work-node-status.js +121 -18
- package/dist/planner/work-node.js +3 -3
- package/dist/planner/work-service-id.js +13 -0
- package/dist/planner/work-service-volume.js +3 -0
- package/dist/planner/work-service.js +6 -0
- package/dist/planner/work-services.js +3 -0
- package/dist/planner/work-volume.js +3 -0
- package/dist/program.js +155 -91
- package/dist/program.spec.js +20 -0
- package/dist/start-watch-processes.js +28 -0
- package/dist/testing/cli.js +73 -0
- package/dist/testing/create-build-file.js +1 -1
- package/dist/testing/example-test-suite.js +54 -0
- package/dist/testing/expect.js +30 -18
- package/dist/testing/get-logger.js +23 -0
- package/dist/testing/get-node.js +2 -2
- package/dist/testing/get-test-context.js +6 -5
- package/dist/testing/get-test-suite.js +2 -51
- package/dist/testing/integration/cache.spec.js +25 -28
- package/dist/testing/integration/cancellation.spec.js +19 -21
- package/dist/testing/integration/clean.spec.js +29 -13
- package/dist/testing/integration/cmd.spec.js +5 -8
- package/dist/testing/integration/concurrency.spec.js +8 -17
- package/dist/testing/integration/docker.spec.js +6 -9
- package/dist/testing/integration/env.spec.js +27 -34
- package/dist/testing/integration/error.spec.js +5 -9
- package/dist/testing/integration/extend.spec.js +32 -0
- package/dist/testing/integration/glob.spec.js +35 -28
- package/dist/testing/integration/include.spec.js +17 -16
- package/dist/testing/integration/invalid.spec.js +3 -2
- package/dist/testing/integration/invalid_loop.spec.js +13 -0
- package/dist/testing/integration/kubernetes.spec.js +15 -0
- package/dist/testing/integration/labels.spec.js +47 -0
- package/dist/testing/integration/local.spec.js +4 -7
- package/dist/testing/integration/monorepo.spec.js +6 -30
- package/dist/testing/integration/multi-line.spec.js +4 -4
- package/dist/testing/integration/program.spec.js +3 -10
- package/dist/testing/integration/reference.spec.js +10 -13
- package/dist/testing/integration/services.spec.js +14 -0
- package/dist/testing/integration/store.spec.js +42 -35
- package/dist/testing/integration/unknown.spec.js +4 -4
- package/dist/testing/integration/validate.spec.js +4 -4
- package/dist/testing/integration/watch.spec.js +25 -23
- package/dist/testing/lazy.js +17 -0
- package/dist/testing/start-watch-processes.js +29 -0
- package/dist/testing/test-suite-setup.js +3 -0
- package/dist/utils/abort-event.js +24 -0
- package/dist/utils/abortable-function.js +71 -0
- package/dist/utils/debouncer.spec.js +8 -8
- package/dist/utils/environment-config.js +13 -0
- package/dist/utils/fail-never.js +1 -1
- package/dist/utils/sleep.spec.js +3 -3
- package/package.json +24 -21
- package/dist/console/get-console-context-mock.js +0 -33
- package/dist/executer/clean.js +0 -22
- package/dist/executer/execute-local.js +0 -58
- package/dist/executer/execute.js +0 -95
- package/dist/executer/execution-context-event.js +0 -3
- package/dist/executer/execution-context-mock.js +0 -3
- package/dist/executer/executor-mock.js +0 -39
- package/dist/executer/get-environment-mock.js +0 -17
- package/dist/executer/get-execution-context-mock.js +0 -19
- package/dist/executer/get-local-executor.js +0 -22
- package/dist/executer/get-ready-work-nodes.js +0 -15
- package/dist/executer/restore.js +0 -22
- package/dist/executer/store.js +0 -23
- package/dist/logging/get-logger.js +0 -23
- package/dist/logging/message-to-console.js +0 -16
- package/dist/optimizer/optimize.js +0 -32
- package/dist/optimizer/work-node-description.js +0 -12
- package/dist/planner/utils/find-build-task.js +0 -18
- package/dist/testing/create-work-tree.js +0 -11
- package/dist/utils/defer.js +0 -57
- package/dist/utils/defer.spec.js +0 -76
|
@@ -1,51 +1,98 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getStateKey = exports.getCacheState = exports.getWorkNodeCacheStats = exports.getServiceNodeCacheStats = void 0;
|
|
4
4
|
const calculate_checksum_1 = require("./calculate-checksum");
|
|
5
5
|
const path_1 = require("path");
|
|
6
|
-
|
|
6
|
+
const crypto_1 = require("crypto");
|
|
7
|
+
async function addWorkNodeCacheStats(result, cwd, path, matcher, context) {
|
|
8
|
+
const exists = await context.file.exists(path);
|
|
9
|
+
if (!exists) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
7
12
|
const stats = await context.file.stats(path);
|
|
8
13
|
if (stats.type === 'file') {
|
|
9
14
|
if (matcher(path)) {
|
|
10
|
-
const checksum = await calculate_checksum_1.calculateChecksum(context, path);
|
|
11
|
-
result.files[path_1.relative(
|
|
15
|
+
const checksum = await (0, calculate_checksum_1.calculateChecksum)(context, path);
|
|
16
|
+
result.files[(0, path_1.relative)(cwd, path)] = { lastModified: stats.lastModified, checksum };
|
|
12
17
|
}
|
|
13
18
|
}
|
|
14
19
|
else if (stats.type === 'directory') {
|
|
15
20
|
const files = await context.file.listFiles(path);
|
|
16
21
|
for (const file of files) {
|
|
17
|
-
const subPath = path_1.join(path, file);
|
|
22
|
+
const subPath = (0, path_1.join)(path, file);
|
|
18
23
|
if (matcher(subPath)) {
|
|
19
|
-
await addWorkNodeCacheStats(result, path_1.join(path, file), matcher, context);
|
|
24
|
+
await addWorkNodeCacheStats(result, cwd, (0, path_1.join)(path, file), matcher, context);
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
}
|
|
23
28
|
}
|
|
29
|
+
async function addWorkServiceCacheStats(result, path, context) {
|
|
30
|
+
const exists = await context.file.exists(path);
|
|
31
|
+
if (!exists) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const stats = await context.file.stats(path);
|
|
35
|
+
if (stats.type === 'file') {
|
|
36
|
+
const checksum = await (0, calculate_checksum_1.calculateChecksum)(context, path);
|
|
37
|
+
result.files[path] = { lastModified: stats.lastModified, checksum };
|
|
38
|
+
}
|
|
39
|
+
else if (stats.type === 'directory') {
|
|
40
|
+
const files = await context.file.listFiles(path);
|
|
41
|
+
for (const file of files) {
|
|
42
|
+
await addWorkServiceCacheStats(result, (0, path_1.join)(path, file), context);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function getServiceNodeCacheStats(cache, environment) {
|
|
47
|
+
const result = {
|
|
48
|
+
files: {},
|
|
49
|
+
};
|
|
50
|
+
for (const mount of cache.mounts) {
|
|
51
|
+
await addWorkServiceCacheStats(result, mount.localPath, environment);
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
exports.getServiceNodeCacheStats = getServiceNodeCacheStats;
|
|
24
56
|
async function getWorkNodeCacheStats(cache, environment) {
|
|
25
57
|
const result = {
|
|
26
|
-
|
|
58
|
+
created: new Date(),
|
|
27
59
|
files: {},
|
|
28
60
|
};
|
|
29
61
|
for (const src of cache.src) {
|
|
30
|
-
await addWorkNodeCacheStats(result, src.absolutePath, (file) => src.matcher(file, cache.cwd), environment);
|
|
62
|
+
await addWorkNodeCacheStats(result, cache.cwd, src.absolutePath, (file) => src.matcher(file, cache.cwd), environment);
|
|
31
63
|
}
|
|
32
64
|
return result;
|
|
33
65
|
}
|
|
34
66
|
exports.getWorkNodeCacheStats = getWorkNodeCacheStats;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
67
|
+
function getCacheState(status, node, cache, current) {
|
|
68
|
+
if (cache) {
|
|
69
|
+
for (const key of Object.keys(cache.files)) {
|
|
70
|
+
if ((node.caching === 'checksum' && current.files[key]?.checksum !== cache.files[key].checksum) ||
|
|
71
|
+
(node.caching === 'modify-date' && current.files[key]?.lastModified !== cache.files[key].lastModified)) {
|
|
72
|
+
status.write('debug', node.caching === 'checksum'
|
|
73
|
+
? `${key} changed from checksum ${cache.files[key].checksum} to ${current.files[key]?.checksum}`
|
|
74
|
+
: `${key} changed from last modified ${cache.files[key].lastModified} to ${current.files[key]?.lastModified}`);
|
|
75
|
+
status.write('debug', `${node.name} can't be skipped because ${key} has been modified`);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
stateKey: getStateKey(current, node.caching),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
exports.getCacheState = getCacheState;
|
|
85
|
+
function getStateKey(stats, cacheMethod) {
|
|
86
|
+
const contents = [];
|
|
87
|
+
for (const key of Object.keys(stats.files)) {
|
|
88
|
+
if (cacheMethod === 'checksum') {
|
|
89
|
+
contents.push(`${key}:${stats.files[key].checksum}`);
|
|
90
|
+
}
|
|
91
|
+
else if (cacheMethod === 'modify-date') {
|
|
92
|
+
contents.push(`${key}:${stats.files[key].lastModified}`);
|
|
46
93
|
}
|
|
47
94
|
}
|
|
48
|
-
return
|
|
95
|
+
return (0, crypto_1.createHash)('md5').update(contents.join(',')).digest('hex');
|
|
49
96
|
}
|
|
50
|
-
exports.
|
|
97
|
+
exports.getStateKey = getStateKey;
|
|
51
98
|
//# sourceMappingURL=get-work-node-cache-stats.js.map
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.readCache = void 0;
|
|
4
4
|
const get_cache_directory_1 = require("./get-cache-directory");
|
|
5
5
|
async function readCache(node, context) {
|
|
6
|
-
const cacheFile = get_cache_directory_1.getCacheStatsFile(node.id
|
|
6
|
+
const cacheFile = (0, get_cache_directory_1.getCacheStatsFile)(node.id);
|
|
7
7
|
if (!(await context.file.exists(cacheFile))) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
@@ -11,7 +11,7 @@ async function readCache(node, context) {
|
|
|
11
11
|
return JSON.parse(await context.file.read(cacheFile));
|
|
12
12
|
}
|
|
13
13
|
catch (e) {
|
|
14
|
-
|
|
14
|
+
context.status.task(node).write('error', `unable to read cache ${cacheFile}`);
|
|
15
15
|
}
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getWorkNodeCacheDescription = void 0;
|
|
4
4
|
const os_1 = require("os");
|
|
5
|
-
function getWorkNodeCacheDescription(task
|
|
5
|
+
function getWorkNodeCacheDescription(task) {
|
|
6
6
|
return {
|
|
7
|
-
shell: task.shell,
|
|
8
|
-
image: task.image,
|
|
9
|
-
platform: task.image ?
|
|
10
|
-
generates:
|
|
11
|
-
src:
|
|
12
|
-
deps:
|
|
13
|
-
envs: Object.keys(task.envs
|
|
7
|
+
shell: task.shell ?? undefined,
|
|
8
|
+
image: task.image ?? undefined,
|
|
9
|
+
platform: task.image ? 'container' : (0, os_1.platform)(),
|
|
10
|
+
generates: task.generates.sort() ?? undefined,
|
|
11
|
+
src: task.src.map((s) => s.relativePath).sort() ?? undefined,
|
|
12
|
+
deps: task.deps.map((d) => d.name).sort() ?? undefined,
|
|
13
|
+
envs: Object.keys(task.envs)
|
|
14
14
|
.sort()
|
|
15
15
|
.reduce((map, key) => {
|
|
16
16
|
map[key] = task.envs[key];
|
|
17
17
|
return map;
|
|
18
|
-
}, {}),
|
|
19
|
-
cmds:
|
|
18
|
+
}, {}) ?? undefined,
|
|
19
|
+
cmds: task.cmds.map((c) => {
|
|
20
20
|
if (typeof c === 'string') {
|
|
21
21
|
return { cmd: c, path: '' };
|
|
22
22
|
}
|
|
@@ -24,7 +24,8 @@ function getWorkNodeCacheDescription(task, deps) {
|
|
|
24
24
|
return { cmd: c.cmd, path: c.path ?? '' };
|
|
25
25
|
}
|
|
26
26
|
}),
|
|
27
|
-
mounts: task.mounts.sort(),
|
|
27
|
+
mounts: task.mounts.sort() ?? undefined,
|
|
28
|
+
cwd: task.cwd,
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
exports.getWorkNodeCacheDescription = getWorkNodeCacheDescription;
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeWorkNodeCache = void 0;
|
|
4
4
|
const get_work_node_cache_stats_1 = require("./get-work-node-cache-stats");
|
|
5
|
-
const work_node_description_1 = require("./work-node-description");
|
|
6
5
|
const get_cache_directory_1 = require("./get-cache-directory");
|
|
6
|
+
const work_node_cache_description_1 = require("./work-node-cache-description");
|
|
7
7
|
async function writeWorkNodeCache(node, context) {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
8
|
+
const status = context.status.task(node);
|
|
9
|
+
const cachePath = (0, get_cache_directory_1.getCacheDirectory)(node.id);
|
|
10
|
+
const cacheFile = (0, get_cache_directory_1.getCacheStatsFile)(node.id);
|
|
11
|
+
const cacheDescriptionFile = (0, get_cache_directory_1.getCacheDescriptionFile)(node.id);
|
|
12
|
+
const cache = await (0, get_work_node_cache_stats_1.getWorkNodeCacheStats)(node, context);
|
|
13
|
+
const taskDescription = (0, work_node_cache_description_1.getWorkNodeCacheDescription)(node.plannedTask);
|
|
13
14
|
await context.file.createDirectory(cachePath);
|
|
14
|
-
|
|
15
|
+
status.write('debug', `write cache description for ${node.name} to ${cacheDescriptionFile}`);
|
|
15
16
|
await context.file.writeFile(cacheDescriptionFile, JSON.stringify(taskDescription, null, 2));
|
|
16
|
-
|
|
17
|
+
status.write('debug', `write file cache for ${node.name} to ${cacheFile}`);
|
|
17
18
|
await context.file.writeFile(cacheFile, JSON.stringify(cache, null, 2));
|
|
18
19
|
}
|
|
19
20
|
exports.writeWorkNodeCache = writeWorkNodeCache;
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getBuildFile = void 0;
|
|
4
4
|
const read_build_file_1 = require("./read-build-file");
|
|
5
5
|
function getBuildFile(fileName, context) {
|
|
6
|
-
return read_build_file_1.readBuildFile(fileName, {}, context);
|
|
6
|
+
return (0, read_build_file_1.readBuildFile)(fileName, {}, context);
|
|
7
7
|
}
|
|
8
8
|
exports.getBuildFile = getBuildFile;
|
|
9
9
|
//# sourceMappingURL=get-build-file.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseBoolean = void 0;
|
|
4
|
+
const parse_context_1 = require("./parse-context");
|
|
5
|
+
function parseBoolean(ctx, name, value, optional) {
|
|
6
|
+
if (value == null || value === undefined) {
|
|
7
|
+
if (optional) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} -> ${name} is missing boolean`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (typeof value === 'boolean') {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
else if (typeof value === 'string') {
|
|
18
|
+
const lowerCaseValue = value.toLowerCase();
|
|
19
|
+
if (lowerCaseValue === 'true') {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
else if (lowerCaseValue === 'false') {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} -> ${name} invalid boolean "${value}"`);
|
|
27
|
+
}
|
|
28
|
+
exports.parseBoolean = parseBoolean;
|
|
29
|
+
//# sourceMappingURL=parse-boolean.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parse_boolean_1 = require("./parse-boolean");
|
|
4
|
+
describe('parse-boolean', () => {
|
|
5
|
+
const context = { type: 'task', name: 'example', fileName: '' };
|
|
6
|
+
it('should parse true', () => {
|
|
7
|
+
const value = (0, parse_boolean_1.parseBoolean)(context, 'watch', true, false);
|
|
8
|
+
expect(value).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
it('should parse "true"', () => {
|
|
11
|
+
const value = (0, parse_boolean_1.parseBoolean)(context, 'watch', 'true', false);
|
|
12
|
+
expect(value).toBeTruthy();
|
|
13
|
+
});
|
|
14
|
+
it('should parse "TRUE"', () => {
|
|
15
|
+
const value = (0, parse_boolean_1.parseBoolean)(context, 'watch', 'TRUE', false);
|
|
16
|
+
expect(value).toBeTruthy();
|
|
17
|
+
});
|
|
18
|
+
it('should parse false', () => {
|
|
19
|
+
const value = (0, parse_boolean_1.parseBoolean)(context, 'watch', false, false);
|
|
20
|
+
expect(value).toBeFalsy();
|
|
21
|
+
});
|
|
22
|
+
it('should parse "false"', () => {
|
|
23
|
+
const value = (0, parse_boolean_1.parseBoolean)(context, 'watch', 'false', false);
|
|
24
|
+
expect(value).toBeFalsy();
|
|
25
|
+
});
|
|
26
|
+
it('should parse "FALSE"', () => {
|
|
27
|
+
const value = (0, parse_boolean_1.parseBoolean)(context, 'watch', 'FALSE', false);
|
|
28
|
+
expect(value).toBeFalsy();
|
|
29
|
+
});
|
|
30
|
+
it('should not allow 2', () => {
|
|
31
|
+
expect(() => (0, parse_boolean_1.parseBoolean)(context, 'watch', 2, false)).toThrow();
|
|
32
|
+
});
|
|
33
|
+
it('should not allow "test"', () => {
|
|
34
|
+
expect(() => (0, parse_boolean_1.parseBoolean)(context, 'watch', 'test', false)).toThrow();
|
|
35
|
+
});
|
|
36
|
+
it('should parse null if optional', () => {
|
|
37
|
+
const value = (0, parse_boolean_1.parseBoolean)(context, 'watch', null, true);
|
|
38
|
+
expect(value).toBeNull();
|
|
39
|
+
});
|
|
40
|
+
it('should parse undefined if optional', () => {
|
|
41
|
+
const value = (0, parse_boolean_1.parseBoolean)(context, 'watch', undefined, true);
|
|
42
|
+
expect(value).toBeNull();
|
|
43
|
+
});
|
|
44
|
+
it('should not allow null if optional', () => {
|
|
45
|
+
expect(() => (0, parse_boolean_1.parseBoolean)(context, 'watch', null, false)).toThrow();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=parse-boolean.spec.js.map
|
|
@@ -12,11 +12,11 @@ async function parseBuildFileReferences(type, fileName, files, refs, context) {
|
|
|
12
12
|
}
|
|
13
13
|
const result = {};
|
|
14
14
|
for (const [key, value] of Object.entries(refs || {})) {
|
|
15
|
-
const referenceFileName = path_1.join(path_1.dirname(fileName), value);
|
|
15
|
+
const referenceFileName = (0, path_1.join)((0, path_1.dirname)(fileName), value);
|
|
16
16
|
if (!(await context.file.exists(referenceFileName))) {
|
|
17
17
|
throw new Error(`${fileName} ${type} ${key} not found`);
|
|
18
18
|
}
|
|
19
|
-
result[key] = await read_build_file_1.readBuildFile(referenceFileName, files, context);
|
|
19
|
+
result[key] = await (0, read_build_file_1.readBuildFile)(referenceFileName, files, context);
|
|
20
20
|
}
|
|
21
21
|
return result;
|
|
22
22
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseBuildFileServices = void 0;
|
|
4
|
+
const parse_string_array_1 = require("./parse-string-array");
|
|
5
|
+
const parse_envs_1 = require("./parse-envs");
|
|
6
|
+
const parse_string_map_1 = require("./parse-string-map");
|
|
7
|
+
const parse_healthcheck_1 = require("./parse-healthcheck");
|
|
8
|
+
const parse_context_1 = require("./parse-context");
|
|
9
|
+
const parse_string_1 = require("./parse-string");
|
|
10
|
+
const parse_service_selector_1 = require("./parse-service-selector");
|
|
11
|
+
const validKeys = ['image', 'ports', 'envs', 'mounts', 'volumes', 'healthcheck', 'context', 'selector', 'kubeconfig'];
|
|
12
|
+
function parseBuildFileServices(fileName, value, buildFile) {
|
|
13
|
+
const services = {};
|
|
14
|
+
if (!value) {
|
|
15
|
+
return services;
|
|
16
|
+
}
|
|
17
|
+
if (typeof value !== 'object') {
|
|
18
|
+
throw new Error(`${fileName} services need to be an object`);
|
|
19
|
+
}
|
|
20
|
+
for (const [key, serviceValue] of Object.entries(value || {})) {
|
|
21
|
+
const ctx = { fileName, name: key, type: 'service' };
|
|
22
|
+
const hasImage = !!serviceValue.image;
|
|
23
|
+
const hasContextSelector = !!serviceValue.context && !!serviceValue.selector;
|
|
24
|
+
const hasHealthcheck = !!serviceValue.healthcheck;
|
|
25
|
+
if (!hasImage && !hasContextSelector) {
|
|
26
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} needs an image or a context/selector`);
|
|
27
|
+
}
|
|
28
|
+
if (hasImage && hasContextSelector) {
|
|
29
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} can not have an image and a context/selector`);
|
|
30
|
+
}
|
|
31
|
+
if (hasContextSelector && hasHealthcheck) {
|
|
32
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} healthchecks only work with images`);
|
|
33
|
+
}
|
|
34
|
+
services[key] = {
|
|
35
|
+
image: (0, parse_string_1.parseString)(ctx, 'image', serviceValue.image, !hasImage),
|
|
36
|
+
description: (0, parse_string_1.parseString)(ctx, 'description', serviceValue.description, true),
|
|
37
|
+
ports: (0, parse_string_array_1.parseStringArray)(ctx, 'ports', serviceValue.ports),
|
|
38
|
+
envs: (0, parse_envs_1.parseEnvs)(ctx, serviceValue.envs, buildFile.envs),
|
|
39
|
+
mounts: (0, parse_string_array_1.parseStringArray)(ctx, 'mounts', serviceValue.mounts),
|
|
40
|
+
volumes: (0, parse_string_array_1.parseStringArray)(ctx, 'volumes', serviceValue.volumes),
|
|
41
|
+
healthcheck: (0, parse_healthcheck_1.parseHealthcheck)(ctx, serviceValue.healthcheck),
|
|
42
|
+
labels: (0, parse_string_map_1.parseStringMap)(ctx, 'labels', serviceValue.labels),
|
|
43
|
+
cmd: (0, parse_string_1.parseString)(ctx, 'cmd', serviceValue.cmd, true),
|
|
44
|
+
unknownProps: Object.keys(serviceValue)
|
|
45
|
+
.filter((k) => validKeys.indexOf(k) === -1)
|
|
46
|
+
.reduce((map, k) => {
|
|
47
|
+
map[k] = serviceValue[k];
|
|
48
|
+
return map;
|
|
49
|
+
}, {}),
|
|
50
|
+
kubeconfig: (0, parse_string_1.parseString)(ctx, 'kubeconfig', serviceValue.kubeconfig, true),
|
|
51
|
+
selector: (0, parse_service_selector_1.parseServiceSelector)(ctx, serviceValue.selector, !hasContextSelector),
|
|
52
|
+
context: (0, parse_string_1.parseString)(ctx, 'context', serviceValue.context, !hasContextSelector),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return services;
|
|
56
|
+
}
|
|
57
|
+
exports.parseBuildFileServices = parseBuildFileServices;
|
|
58
|
+
//# sourceMappingURL=parse-build-file-services.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseBuildFileCommand = void 0;
|
|
4
|
-
|
|
4
|
+
const parse_context_1 = require("./parse-context");
|
|
5
|
+
function parseBuildFileCommand(ctx, value) {
|
|
5
6
|
if (!value) {
|
|
6
7
|
return null;
|
|
7
8
|
}
|
|
8
9
|
if (!(value instanceof Array)) {
|
|
9
|
-
throw new Error(`${
|
|
10
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} cmds needs to be an array`);
|
|
10
11
|
}
|
|
11
12
|
return value.map((cmd) => {
|
|
12
13
|
if (typeof cmd === 'string') {
|
|
@@ -14,11 +15,11 @@ function parseBuildFileCommand(fileName, taskName, value) {
|
|
|
14
15
|
}
|
|
15
16
|
else if (typeof cmd === 'object' && !!cmd.cmd) {
|
|
16
17
|
if (!(typeof cmd.cmd === 'string')) {
|
|
17
|
-
throw new Error(`${
|
|
18
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} cmd needs to be a string`);
|
|
18
19
|
}
|
|
19
20
|
if (cmd.path) {
|
|
20
21
|
if (!(typeof cmd.path === 'string')) {
|
|
21
|
-
throw new Error(`${
|
|
22
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} cmd path needs to be a string`);
|
|
22
23
|
}
|
|
23
24
|
return { cmd: cmd.cmd.trim(), path: cmd.path, type: 'cmd' };
|
|
24
25
|
}
|
|
@@ -27,7 +28,7 @@ function parseBuildFileCommand(fileName, taskName, value) {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
else {
|
|
30
|
-
throw new Error(`${
|
|
31
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} unknown cmd`);
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
}
|
|
@@ -4,11 +4,11 @@ exports.parseBuildFileTaskSource = void 0;
|
|
|
4
4
|
const minimatch_1 = require("minimatch");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const parse_string_array_1 = require("./parse-string-array");
|
|
7
|
-
function parseBuildFileTaskSource(
|
|
7
|
+
function parseBuildFileTaskSource(ctx, value, environment) {
|
|
8
8
|
if (!value) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
-
const sources = parse_string_array_1.parseStringArray(
|
|
11
|
+
const sources = (0, parse_string_array_1.parseStringArray)(ctx, 'src', value);
|
|
12
12
|
if (!sources) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
@@ -19,7 +19,7 @@ function parseBuildFileTaskSource(fileName, taskName, value, environment) {
|
|
|
19
19
|
if (wildcardIndex === 0) {
|
|
20
20
|
result.push({
|
|
21
21
|
matcher: (file, cwd) => {
|
|
22
|
-
const matcher = new minimatch_1.Minimatch(path_1.join(cwd, source), { dot: true });
|
|
22
|
+
const matcher = new minimatch_1.Minimatch((0, path_1.join)(cwd, source), { dot: true });
|
|
23
23
|
const match = matcher.match(file);
|
|
24
24
|
if (match) {
|
|
25
25
|
environment.console.debug(`file ${file} matches source ${source}`);
|
|
@@ -36,7 +36,7 @@ function parseBuildFileTaskSource(fileName, taskName, value, environment) {
|
|
|
36
36
|
const prefixSource = source.substr(0, wildcardIndex);
|
|
37
37
|
result.push({
|
|
38
38
|
matcher: (file, cwd) => {
|
|
39
|
-
const matcher = new minimatch_1.Minimatch(path_1.join(cwd, source), { dot: true });
|
|
39
|
+
const matcher = new minimatch_1.Minimatch((0, path_1.join)(cwd, source), { dot: true });
|
|
40
40
|
const match = matcher.match(file);
|
|
41
41
|
if (match) {
|
|
42
42
|
environment.console.debug(`file ${file} matches source ${source}`);
|
|
@@ -52,7 +52,7 @@ function parseBuildFileTaskSource(fileName, taskName, value, environment) {
|
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
result.push({
|
|
55
|
-
matcher: (file, cwd) => file.startsWith(path_1.join(cwd, source)),
|
|
55
|
+
matcher: (file, cwd) => file.startsWith((0, path_1.join)(cwd, source)),
|
|
56
56
|
relativePath: source,
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -8,16 +8,21 @@ const read_env_file_1 = require("./read-env-file");
|
|
|
8
8
|
const parse_string_array_1 = require("./parse-string-array");
|
|
9
9
|
const parse_build_file_task_source_1 = require("./parse-build-file-task-source");
|
|
10
10
|
const parse_build_file_task_command_1 = require("./parse-build-file-task-command");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
11
|
+
const parse_build_file_services_1 = require("./parse-build-file-services");
|
|
12
|
+
const parse_string_map_1 = require("./parse-string-map");
|
|
13
|
+
const parse_string_1 = require("./parse-string");
|
|
14
|
+
const parse_boolean_1 = require("./parse-boolean");
|
|
15
|
+
const validTaskKeys = ['envs', 'src', 'needs', 'deps', 'generates', 'labels', 'description', 'extend', 'cmds', 'watch'];
|
|
16
|
+
const validDockerTaskKeys = ['image', 'mounts', 'ports', 'shell', ...validTaskKeys];
|
|
13
17
|
async function parseBuildFile(fileName, files, input, context) {
|
|
14
18
|
const result = {
|
|
15
19
|
fileName,
|
|
16
20
|
includes: {},
|
|
17
21
|
tasks: {},
|
|
18
|
-
path: path_1.dirname(fileName),
|
|
22
|
+
path: (0, path_1.dirname)(fileName),
|
|
19
23
|
references: {},
|
|
20
24
|
envs: {},
|
|
25
|
+
services: {},
|
|
21
26
|
};
|
|
22
27
|
files[fileName] = result;
|
|
23
28
|
if (typeof input !== 'object') {
|
|
@@ -26,40 +31,47 @@ async function parseBuildFile(fileName, files, input, context) {
|
|
|
26
31
|
if (!input) {
|
|
27
32
|
return result;
|
|
28
33
|
}
|
|
29
|
-
result.envs = await read_env_file_1.readEnvFile(path_1.dirname(fileName), result.envs, context);
|
|
34
|
+
result.envs = await (0, read_env_file_1.readEnvFile)((0, path_1.dirname)(fileName), result.envs, context);
|
|
30
35
|
for (const [key, value] of Object.entries(input)) {
|
|
31
36
|
if (key === 'includes') {
|
|
32
|
-
result.includes = await parse_build_file_references_1.parseBuildFileReferences('include', fileName, files, value || {}, context);
|
|
37
|
+
result.includes = await (0, parse_build_file_references_1.parseBuildFileReferences)('include', fileName, files, value || {}, context);
|
|
33
38
|
}
|
|
34
39
|
else if (key === 'references') {
|
|
35
|
-
result.references = await parse_build_file_references_1.parseBuildFileReferences('reference', fileName, files, value || {}, context);
|
|
40
|
+
result.references = await (0, parse_build_file_references_1.parseBuildFileReferences)('reference', fileName, files, value || {}, context);
|
|
36
41
|
}
|
|
37
42
|
else if (key === 'envs') {
|
|
38
|
-
result.envs = parse_envs_1.parseEnvs(fileName, value || {}, result.envs);
|
|
43
|
+
result.envs = (0, parse_envs_1.parseEnvs)({ type: 'buildfile', fileName }, value || {}, result.envs);
|
|
44
|
+
}
|
|
45
|
+
else if (key === 'services') {
|
|
46
|
+
result.services = (0, parse_build_file_services_1.parseBuildFileServices)(fileName, value || {}, result);
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
49
|
const tasks = 'tasks' in input ? input['tasks'] : null;
|
|
42
50
|
if (tasks && typeof tasks !== 'object') {
|
|
43
51
|
throw new Error(`${fileName} tasks need to be an object`);
|
|
44
52
|
}
|
|
45
|
-
for (const key of Object.keys(tasks)) {
|
|
53
|
+
for (const key of Object.keys(tasks || {})) {
|
|
46
54
|
const value = tasks[key];
|
|
47
55
|
if (typeof value !== 'object') {
|
|
48
56
|
throw new Error(`${fileName} task ${key} needs to be an object`);
|
|
49
57
|
}
|
|
58
|
+
const ctx = { fileName, name: key, type: 'task' };
|
|
50
59
|
const validKeys = value.image ? validDockerTaskKeys : validTaskKeys;
|
|
51
60
|
result.tasks[key] = {
|
|
52
|
-
envs: parse_envs_1.parseEnvs(
|
|
53
|
-
mounts: parse_string_array_1.parseStringArray(
|
|
54
|
-
src: parse_build_file_task_source_1.parseBuildFileTaskSource(
|
|
55
|
-
deps: parse_string_array_1.parseStringArray(
|
|
56
|
-
generates: parse_string_array_1.parseStringArray(
|
|
57
|
-
description:
|
|
61
|
+
envs: (0, parse_envs_1.parseEnvs)(ctx, value.envs || {}, {}),
|
|
62
|
+
mounts: (0, parse_string_array_1.parseStringArray)(ctx, 'mounts', value.mounts),
|
|
63
|
+
src: (0, parse_build_file_task_source_1.parseBuildFileTaskSource)(ctx, value.src, context),
|
|
64
|
+
deps: (0, parse_string_array_1.parseStringArray)(ctx, 'deps', value.deps),
|
|
65
|
+
generates: (0, parse_string_array_1.parseStringArray)(ctx, 'generates', value.generates),
|
|
66
|
+
description: (0, parse_string_1.parseString)(ctx, 'description', value.description, true)?.trim() ?? null,
|
|
67
|
+
labels: (0, parse_string_map_1.parseStringMap)(ctx, 'labels', value.labels),
|
|
58
68
|
image: value.image || null,
|
|
59
69
|
extend: value.extend || null,
|
|
60
70
|
shell: value.shell || null,
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
needs: value.needs || null,
|
|
72
|
+
continuous: (0, parse_boolean_1.parseBoolean)(ctx, 'continuous', value.continuous, true),
|
|
73
|
+
ports: (0, parse_string_array_1.parseStringArray)(ctx, 'ports', value.ports),
|
|
74
|
+
cmds: (0, parse_build_file_task_command_1.parseBuildFileCommand)(ctx, value.cmds),
|
|
63
75
|
unknownProps: Object.keys(value)
|
|
64
76
|
.filter((k) => validKeys.indexOf(k) === -1)
|
|
65
77
|
.reduce((map, k) => {
|
|
@@ -67,7 +79,7 @@ async function parseBuildFile(fileName, files, input, context) {
|
|
|
67
79
|
return map;
|
|
68
80
|
}, {}),
|
|
69
81
|
platform: null,
|
|
70
|
-
|
|
82
|
+
cache: value.caching || null,
|
|
71
83
|
};
|
|
72
84
|
if (Object.keys(result.tasks[key].unknownProps).length > 0) {
|
|
73
85
|
context.console.warn(`unknown props ${Object.keys(result.tasks[key].unknownProps)} for ${key} in ${fileName}`);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseContextDescription = void 0;
|
|
4
|
+
function parseContextDescription(ctx) {
|
|
5
|
+
if (ctx.type === 'buildfile') {
|
|
6
|
+
return `${ctx.fileName} ${ctx.type}`;
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return `${ctx.fileName} ${ctx.type} ${ctx.name}`;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.parseContextDescription = parseContextDescription;
|
|
13
|
+
//# sourceMappingURL=parse-context.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseEnvs = void 0;
|
|
4
|
-
|
|
4
|
+
const parse_context_1 = require("./parse-context");
|
|
5
|
+
function parseEnvs(ctx, envs, baseEnvs) {
|
|
5
6
|
if (!envs) {
|
|
6
7
|
return baseEnvs;
|
|
7
8
|
}
|
|
8
9
|
if (typeof envs !== 'object') {
|
|
9
|
-
throw new Error(`${
|
|
10
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} envs need to be an object`);
|
|
10
11
|
}
|
|
11
12
|
const result = {
|
|
12
13
|
...baseEnvs,
|
|
@@ -19,7 +20,7 @@ function parseEnvs(fileName, envs, baseEnvs) {
|
|
|
19
20
|
result[key] = value.toString();
|
|
20
21
|
}
|
|
21
22
|
else {
|
|
22
|
-
throw new Error(`${
|
|
23
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} envs ${key} need to be a string or number`);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
return result;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseHealthcheck = void 0;
|
|
4
|
+
const parse_context_1 = require("./parse-context");
|
|
5
|
+
const parse_string_1 = require("./parse-string");
|
|
6
|
+
function parseHealthcheck(ctx, value) {
|
|
7
|
+
if (value === null || value === undefined) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (typeof value !== 'object') {
|
|
11
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} invalid healthcheck, expecting map`);
|
|
12
|
+
}
|
|
13
|
+
const result = { cmd: '' };
|
|
14
|
+
for (const [key, prop] of Object.entries(value || {})) {
|
|
15
|
+
if (key === 'cmd') {
|
|
16
|
+
result.cmd = (0, parse_string_1.parseString)(ctx, 'healthcheck cmd', prop, false);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} unknown property ${key} in healthcheck`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (!result.cmd) {
|
|
23
|
+
throw new Error(`${(0, parse_context_1.parseContextDescription)(ctx)} invalid healthcheck, missing cmd property`);
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
exports.parseHealthcheck = parseHealthcheck;
|
|
28
|
+
//# sourceMappingURL=parse-healthcheck.js.map
|