@storm-software/k8s-tools 0.42.135 → 0.42.137
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 +24 -0
- package/README.md +1 -1
- package/dist/{chunk-IOKYYZWX.mjs → chunk-2UC4FK3T.mjs} +2 -2
- package/dist/{chunk-EYPBUFPL.mjs → chunk-552QN2NR.mjs} +2 -2
- package/dist/chunk-A7Y3C3GT.js +202 -0
- package/dist/{chunk-DQ6YPI3I.mjs → chunk-ABUSHSLV.mjs} +1 -1
- package/dist/{chunk-OPAEZJF6.mjs → chunk-B3SGBF5T.mjs} +3 -3
- package/dist/{chunk-ZXM4G35O.js → chunk-BCTLJQEZ.js} +3 -3
- package/dist/{chunk-ULPF44XA.mjs → chunk-BKAW2YSB.mjs} +1 -1
- package/dist/{chunk-QJR6N4PL.js → chunk-C55DOLYT.js} +2 -2
- package/dist/{chunk-MNSGJMJV.js → chunk-DVCZGSQU.js} +20 -20
- package/dist/{chunk-EL6QE5FA.js → chunk-EOWUKLS4.js} +4 -4
- package/dist/{chunk-6VH66K6T.js → chunk-F2HUPD62.js} +25 -25
- package/dist/{chunk-F244EGT5.mjs → chunk-FC3SS2PJ.mjs} +1 -1
- package/dist/{chunk-EA47D42R.js → chunk-HDCLRS5K.js} +3 -3
- package/dist/{chunk-3I3ODZKV.mjs → chunk-L73IY6PR.mjs} +3 -3
- package/dist/chunk-LLXF5T2B.mjs +202 -0
- package/dist/chunk-M5IOCZK5.js +136 -0
- package/dist/{chunk-RECN4I7A.mjs → chunk-OBUQ7WTG.mjs} +2 -2
- package/dist/{chunk-MSZUOD43.mjs → chunk-Q3YQLTYS.mjs} +3 -3
- package/dist/chunk-QHDPAEHO.mjs +136 -0
- package/dist/{chunk-A26WMRXU.mjs → chunk-ROFXLFVW.mjs} +1 -1
- package/dist/{chunk-ZJRDUBGT.js → chunk-X6ZEMTJI.js} +6 -6
- package/dist/{chunk-NSW2CKUH.mjs → chunk-ZN7HUYUZ.mjs} +1 -1
- package/dist/{chunk-YOHT3QWT.js → chunk-ZYR5UQEI.js} +4 -4
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +6 -6
- package/dist/generators.js +6 -6
- package/dist/generators.mjs +6 -6
- package/dist/index.js +9 -9
- package/dist/index.mjs +11 -11
- package/dist/src/executors/container-publish/executor.js +4 -4
- package/dist/src/executors/container-publish/executor.mjs +4 -4
- package/dist/src/executors/helm-package/executor.js +4 -4
- package/dist/src/executors/helm-package/executor.mjs +5 -5
- package/dist/src/generators/helm-chart/generator.js +5 -5
- package/dist/src/generators/helm-chart/generator.mjs +5 -5
- package/dist/src/generators/helm-dependency/generator.js +5 -5
- package/dist/src/generators/helm-dependency/generator.mjs +5 -5
- package/dist/src/plugins/docker/index.js +3 -3
- package/dist/src/plugins/docker/index.mjs +3 -3
- package/dist/src/types.mjs +1 -1
- package/dist/src/utils/client.mjs +2 -2
- package/dist/src/utils/ensure-init.mjs +1 -1
- package/dist/src/utils/index.mjs +3 -3
- package/dist/src/utils/prettier.mjs +2 -2
- package/dist/tsup.config.mjs +1 -1
- package/package.json +6 -6
|
@@ -41,7 +41,7 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
41
41
|
warning: "#e3b341",
|
|
42
42
|
danger: "#D8314A",
|
|
43
43
|
fatal: "#51070f",
|
|
44
|
-
performance: "#
|
|
44
|
+
performance: "#13c302",
|
|
45
45
|
link: "#3fa6ff",
|
|
46
46
|
positive: "#22c55e",
|
|
47
47
|
negative: "#dc2626",
|
|
@@ -59,7 +59,7 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
59
59
|
warning: "#f3d371",
|
|
60
60
|
danger: "#D8314A",
|
|
61
61
|
fatal: "#a40e26",
|
|
62
|
-
performance: "#
|
|
62
|
+
performance: "#80fd74",
|
|
63
63
|
link: "#3fa6ff",
|
|
64
64
|
positive: "#22c55e",
|
|
65
65
|
negative: "#dc2626",
|
|
@@ -683,7 +683,7 @@ var fatalColorSchema = z.optional(colorSchema);
|
|
|
683
683
|
schemaRegistry.add(fatalColorSchema, {
|
|
684
684
|
description: "The fatal color of the workspace"
|
|
685
685
|
});
|
|
686
|
-
var performanceColorSchema = z._default(colorSchema, "#
|
|
686
|
+
var performanceColorSchema = z._default(colorSchema, "#80fd74");
|
|
687
687
|
schemaRegistry.add(performanceColorSchema, {
|
|
688
688
|
description: "The performance color of the workspace"
|
|
689
689
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyWorkspaceProjectTokens,
|
|
3
3
|
applyWorkspaceTokens
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ABUSHSLV.mjs";
|
|
5
5
|
import {
|
|
6
6
|
brandIcon,
|
|
7
7
|
findWorkspaceRoot,
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
writeSuccess,
|
|
16
16
|
writeTrace,
|
|
17
17
|
writeWarning
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B3SGBF5T.mjs";
|
|
19
19
|
import {
|
|
20
20
|
createHelmClient
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FC3SS2PJ.mjs";
|
|
22
22
|
|
|
23
23
|
// ../workspace-tools/src/base/base-executor.ts
|
|
24
24
|
import { defu } from "defu";
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applyWorkspaceProjectTokens,
|
|
3
|
+
applyWorkspaceTokens
|
|
4
|
+
} from "./chunk-ABUSHSLV.mjs";
|
|
5
|
+
import {
|
|
6
|
+
brandIcon,
|
|
7
|
+
findWorkspaceRoot,
|
|
8
|
+
formatLogMessage,
|
|
9
|
+
getConfig,
|
|
10
|
+
getStopwatch,
|
|
11
|
+
writeDebug,
|
|
12
|
+
writeError,
|
|
13
|
+
writeFatal,
|
|
14
|
+
writeInfo,
|
|
15
|
+
writeSuccess,
|
|
16
|
+
writeTrace,
|
|
17
|
+
writeWarning
|
|
18
|
+
} from "./chunk-B3SGBF5T.mjs";
|
|
19
|
+
import {
|
|
20
|
+
createHelmClient
|
|
21
|
+
} from "./chunk-QHDPAEHO.mjs";
|
|
22
|
+
|
|
23
|
+
// ../workspace-tools/src/base/base-executor.ts
|
|
24
|
+
import { defu } from "defu";
|
|
25
|
+
var withRunExecutor = (name, executorFn, executorOptions = {}) => async (_options, context) => {
|
|
26
|
+
const stopwatch = getStopwatch(name);
|
|
27
|
+
let options = _options;
|
|
28
|
+
let config = {};
|
|
29
|
+
try {
|
|
30
|
+
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
36
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot;
|
|
37
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || projectRoot || workspaceRoot;
|
|
38
|
+
const projectName = context.projectName;
|
|
39
|
+
config.workspaceRoot = workspaceRoot;
|
|
40
|
+
writeInfo(
|
|
41
|
+
`${brandIcon(config)} Running the ${name} executor for ${projectName} `,
|
|
42
|
+
config
|
|
43
|
+
);
|
|
44
|
+
if (!executorOptions.skipReadingConfig) {
|
|
45
|
+
writeTrace(
|
|
46
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
47
|
+
- workspaceRoot: ${workspaceRoot}
|
|
48
|
+
- projectRoot: ${projectRoot}
|
|
49
|
+
- sourceRoot: ${sourceRoot}
|
|
50
|
+
- projectName: ${projectName}
|
|
51
|
+
`,
|
|
52
|
+
config
|
|
53
|
+
);
|
|
54
|
+
config = await getConfig(workspaceRoot);
|
|
55
|
+
}
|
|
56
|
+
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
57
|
+
writeDebug("Running the applyDefaultOptions hook...", config);
|
|
58
|
+
options = await Promise.resolve(
|
|
59
|
+
executorOptions.hooks.applyDefaultOptions(options, config)
|
|
60
|
+
);
|
|
61
|
+
writeDebug("Completed the applyDefaultOptions hook", config);
|
|
62
|
+
}
|
|
63
|
+
writeTrace(
|
|
64
|
+
`Executor schema options \u2699\uFE0F
|
|
65
|
+
${formatLogMessage(options)}
|
|
66
|
+
`,
|
|
67
|
+
config
|
|
68
|
+
);
|
|
69
|
+
const tokenized = await applyWorkspaceTokens(
|
|
70
|
+
options,
|
|
71
|
+
defu(
|
|
72
|
+
{ workspaceRoot, projectRoot, sourceRoot, projectName, config },
|
|
73
|
+
config,
|
|
74
|
+
context.projectsConfigurations.projects[context.projectName]
|
|
75
|
+
),
|
|
76
|
+
applyWorkspaceProjectTokens
|
|
77
|
+
);
|
|
78
|
+
writeTrace(
|
|
79
|
+
`Executor schema tokenized options \u2699\uFE0F
|
|
80
|
+
${formatLogMessage(tokenized)}
|
|
81
|
+
`,
|
|
82
|
+
config
|
|
83
|
+
);
|
|
84
|
+
if (executorOptions?.hooks?.preProcess) {
|
|
85
|
+
writeDebug("Running the preProcess hook...", config);
|
|
86
|
+
await Promise.resolve(
|
|
87
|
+
executorOptions.hooks.preProcess(tokenized, config)
|
|
88
|
+
);
|
|
89
|
+
writeDebug("Completed the preProcess hook", config);
|
|
90
|
+
}
|
|
91
|
+
const ret = executorFn(tokenized, context, config);
|
|
92
|
+
if (_isFunction(ret?.next)) {
|
|
93
|
+
const asyncGen = ret;
|
|
94
|
+
for await (const iter of asyncGen) {
|
|
95
|
+
void iter;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const result = await Promise.resolve(
|
|
99
|
+
ret
|
|
100
|
+
);
|
|
101
|
+
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
102
|
+
throw new Error(
|
|
103
|
+
`Failure determined while running the ${name} executor
|
|
104
|
+
${formatLogMessage(
|
|
105
|
+
result
|
|
106
|
+
)}`,
|
|
107
|
+
{
|
|
108
|
+
cause: result?.error
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
if (executorOptions?.hooks?.postProcess) {
|
|
113
|
+
writeDebug("Running the postProcess hook...", config);
|
|
114
|
+
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
115
|
+
writeDebug("Completed the postProcess hook", config);
|
|
116
|
+
}
|
|
117
|
+
writeSuccess(`Completed running the ${name} task executor!
|
|
118
|
+
`, config);
|
|
119
|
+
return {
|
|
120
|
+
success: true
|
|
121
|
+
};
|
|
122
|
+
} catch (error) {
|
|
123
|
+
writeFatal(
|
|
124
|
+
"A fatal error occurred while running the executor - the process was forced to terminate",
|
|
125
|
+
config
|
|
126
|
+
);
|
|
127
|
+
writeError(
|
|
128
|
+
`An exception was thrown in the executor's process
|
|
129
|
+
- Details: ${error.message}
|
|
130
|
+
- Stacktrace: ${error.stack}`,
|
|
131
|
+
config
|
|
132
|
+
);
|
|
133
|
+
return {
|
|
134
|
+
success: false
|
|
135
|
+
};
|
|
136
|
+
} finally {
|
|
137
|
+
stopwatch();
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
var _isFunction = (value) => {
|
|
141
|
+
try {
|
|
142
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
143
|
+
} catch (e) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// src/executors/helm-package/executor.ts
|
|
149
|
+
async function serveExecutor(options, context, config) {
|
|
150
|
+
if (!context?.projectName || !context?.projectsConfigurations?.projects?.[context.projectName]?.root) {
|
|
151
|
+
throw new Error("Nx executor context was invalid");
|
|
152
|
+
}
|
|
153
|
+
const helm = createHelmClient();
|
|
154
|
+
if (options.dependencies?.repositories) {
|
|
155
|
+
for (const repository of options.dependencies.repositories) {
|
|
156
|
+
if (repository.name && repository.url) {
|
|
157
|
+
helm.addRepository(repository.name, repository.url);
|
|
158
|
+
} else {
|
|
159
|
+
throw new Error("Repository name and url are required");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (options.dependencies?.update) {
|
|
164
|
+
helm.dependencyUpdate(options.chartFolder);
|
|
165
|
+
}
|
|
166
|
+
if (options.dependencies?.build) {
|
|
167
|
+
helm.dependencyBuild(options.chartFolder);
|
|
168
|
+
}
|
|
169
|
+
const chartPath = await helm.package({
|
|
170
|
+
chartFolder: options.chartFolder,
|
|
171
|
+
outputFolder: options.outputFolder
|
|
172
|
+
});
|
|
173
|
+
if (options.push && chartPath && options.remote) {
|
|
174
|
+
helm.push({
|
|
175
|
+
chartPath,
|
|
176
|
+
remote: options.remote
|
|
177
|
+
});
|
|
178
|
+
} else {
|
|
179
|
+
writeWarning(`Chart packaged at: ${chartPath}`, config);
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
success: true
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
var executor_default = withRunExecutor(
|
|
186
|
+
"Helm Chart Package executor",
|
|
187
|
+
serveExecutor,
|
|
188
|
+
{
|
|
189
|
+
skipReadingConfig: false,
|
|
190
|
+
hooks: {
|
|
191
|
+
applyDefaultOptions: (options) => {
|
|
192
|
+
options.port ??= 4500;
|
|
193
|
+
return options;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
export {
|
|
200
|
+
serveExecutor,
|
|
201
|
+
executor_default
|
|
202
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkXKOZIQT3js = require('./chunk-XKOZIQT3.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkJSFRUBG5js = require('./chunk-JSFRUBG5.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkRECJ3G6Fjs = require('./chunk-RECJ3G6F.js');
|
|
10
|
+
|
|
11
|
+
// src/utils/client.ts
|
|
12
|
+
var _child_process = require('child_process');
|
|
13
|
+
var HelmClient = class extends _chunkJSFRUBG5js.AbstractHelmClient {
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of HelmClient
|
|
16
|
+
*/
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
}
|
|
20
|
+
package(options) {
|
|
21
|
+
let chartPath = void 0;
|
|
22
|
+
let output = {};
|
|
23
|
+
try {
|
|
24
|
+
output = this.runCommand([
|
|
25
|
+
"helm",
|
|
26
|
+
"package",
|
|
27
|
+
options.chartFolder,
|
|
28
|
+
"-d",
|
|
29
|
+
options.outputFolder
|
|
30
|
+
]);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
if (_optionalChain([err, 'optionalAccess', _ => _.stderr, 'access', _2 => _2.length]) > 0 && _optionalChain([err, 'optionalAccess', _3 => _3.exitCode]) !== 0) {
|
|
33
|
+
throw new Error(`Failed to package chart: ${err.stderr}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (_optionalChain([output, 'optionalAccess', _4 => _4.stderr, 'access', _5 => _5.length]) > 0 && _optionalChain([output, 'optionalAccess', _6 => _6.exitCode]) !== 0) {
|
|
37
|
+
throw new Error(`Failed to package chart: ${output.stderr}`);
|
|
38
|
+
}
|
|
39
|
+
const match = _optionalChain([output, 'access', _7 => _7.stdout, 'optionalAccess', _8 => _8.match, 'call', _9 => _9(
|
|
40
|
+
/Successfully packaged chart and saved it to: (.+)/
|
|
41
|
+
)]);
|
|
42
|
+
if (!match || match.length < 2) {
|
|
43
|
+
throw new Error("Failed to parse chart path from helm output");
|
|
44
|
+
}
|
|
45
|
+
chartPath = _optionalChain([match, 'access', _10 => _10[1], 'optionalAccess', _11 => _11.trim, 'call', _12 => _12()]);
|
|
46
|
+
return new Promise((resolve) => resolve(chartPath));
|
|
47
|
+
}
|
|
48
|
+
push(options) {
|
|
49
|
+
try {
|
|
50
|
+
this.runCommand(["helm", "push", options.chartPath, options.remote]);
|
|
51
|
+
} catch (err) {
|
|
52
|
+
if (_optionalChain([err, 'optionalAccess', _13 => _13.stderr, 'access', _14 => _14.length]) > 0 && _optionalChain([err, 'optionalAccess', _15 => _15.exitCode]) !== 0) {
|
|
53
|
+
throw new Error(`Failed to push chart: ${err.stderr}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
dependencyUpdate(chartFolder) {
|
|
58
|
+
try {
|
|
59
|
+
this.runCommand(["helm", "dependency", "update", chartFolder]);
|
|
60
|
+
} catch (err) {
|
|
61
|
+
if (_optionalChain([err, 'optionalAccess', _16 => _16.stderr, 'access', _17 => _17.length]) > 0 && _optionalChain([err, 'optionalAccess', _18 => _18.exitCode]) !== 0) {
|
|
62
|
+
throw new Error(`Failed to update chart dependencies: ${err.stderr}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
dependencyBuild(chartFolder) {
|
|
67
|
+
try {
|
|
68
|
+
this.runCommand(["helm", "dependency", "build", chartFolder]);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
if (_optionalChain([err, 'optionalAccess', _19 => _19.stderr, 'access', _20 => _20.length]) > 0 && _optionalChain([err, 'optionalAccess', _21 => _21.exitCode]) !== 0) {
|
|
71
|
+
throw new Error(`Failed to build chart dependencies: ${err.stderr}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
addRepository(name, url) {
|
|
76
|
+
try {
|
|
77
|
+
this.runCommand(["helm", "repo", "add", name, url]);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
if (_optionalChain([err, 'optionalAccess', _22 => _22.stderr, 'access', _23 => _23.length]) > 0 && _optionalChain([err, 'optionalAccess', _24 => _24.exitCode]) !== 0) {
|
|
80
|
+
throw new Error(`Failed to add repository: ${err.stderr}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Initialize Helm
|
|
86
|
+
*
|
|
87
|
+
* @returns A promise
|
|
88
|
+
*/
|
|
89
|
+
async initialize() {
|
|
90
|
+
if (this.initialized) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
this.runCommand(["helm", "version"]);
|
|
95
|
+
} catch (err) {
|
|
96
|
+
if (_optionalChain([err, 'optionalAccess', _25 => _25.stderr, 'access', _26 => _26.length]) > 0 && _optionalChain([err, 'optionalAccess', _27 => _27.exitCode]) !== 0) {
|
|
97
|
+
throw new Error(`Helm is not installed: ${err.stderr}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return new Promise((resolve) => {
|
|
101
|
+
this.initialized = true;
|
|
102
|
+
resolve();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
runCommand(commands) {
|
|
106
|
+
return _child_process.execSync.call(void 0, commands.filter(Boolean).join(" "), {
|
|
107
|
+
encoding: "utf8",
|
|
108
|
+
windowsHide: true,
|
|
109
|
+
maxBuffer: 1024 * 1e6,
|
|
110
|
+
stdio: "pipe"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
_chunkRECJ3G6Fjs.__decorateClass.call(void 0, [
|
|
115
|
+
_chunkXKOZIQT3js.ensureInitialized
|
|
116
|
+
], HelmClient.prototype, "package", 1);
|
|
117
|
+
_chunkRECJ3G6Fjs.__decorateClass.call(void 0, [
|
|
118
|
+
_chunkXKOZIQT3js.ensureInitialized
|
|
119
|
+
], HelmClient.prototype, "push", 1);
|
|
120
|
+
_chunkRECJ3G6Fjs.__decorateClass.call(void 0, [
|
|
121
|
+
_chunkXKOZIQT3js.ensureInitialized
|
|
122
|
+
], HelmClient.prototype, "dependencyUpdate", 1);
|
|
123
|
+
_chunkRECJ3G6Fjs.__decorateClass.call(void 0, [
|
|
124
|
+
_chunkXKOZIQT3js.ensureInitialized
|
|
125
|
+
], HelmClient.prototype, "dependencyBuild", 1);
|
|
126
|
+
_chunkRECJ3G6Fjs.__decorateClass.call(void 0, [
|
|
127
|
+
_chunkXKOZIQT3js.ensureInitialized
|
|
128
|
+
], HelmClient.prototype, "addRepository", 1);
|
|
129
|
+
var createHelmClient = () => {
|
|
130
|
+
return new HelmClient();
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
exports.HelmClient = HelmClient; exports.createHelmClient = createHelmClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyWorkspaceBaseTokens,
|
|
3
3
|
applyWorkspaceTokens
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ABUSHSLV.mjs";
|
|
5
5
|
import {
|
|
6
6
|
brandIcon,
|
|
7
7
|
findWorkspaceRoot,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
writeInfo,
|
|
14
14
|
writeSuccess,
|
|
15
15
|
writeTrace
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-B3SGBF5T.mjs";
|
|
17
17
|
|
|
18
18
|
// ../workspace-tools/src/base/base-generator.ts
|
|
19
19
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withRunGenerator
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OBUQ7WTG.mjs";
|
|
4
4
|
import {
|
|
5
5
|
writeDebug
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B3SGBF5T.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__dirname
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ROFXLFVW.mjs";
|
|
10
10
|
|
|
11
11
|
// src/generators/helm-chart/generator.ts
|
|
12
12
|
import {
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensureInitialized
|
|
3
|
+
} from "./chunk-HGXQ6SSU.mjs";
|
|
4
|
+
import {
|
|
5
|
+
AbstractHelmClient
|
|
6
|
+
} from "./chunk-YXXZO2AJ.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__decorateClass
|
|
9
|
+
} from "./chunk-ROFXLFVW.mjs";
|
|
10
|
+
|
|
11
|
+
// src/utils/client.ts
|
|
12
|
+
import { execSync } from "node:child_process";
|
|
13
|
+
var HelmClient = class extends AbstractHelmClient {
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of HelmClient
|
|
16
|
+
*/
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
}
|
|
20
|
+
package(options) {
|
|
21
|
+
let chartPath = void 0;
|
|
22
|
+
let output = {};
|
|
23
|
+
try {
|
|
24
|
+
output = this.runCommand([
|
|
25
|
+
"helm",
|
|
26
|
+
"package",
|
|
27
|
+
options.chartFolder,
|
|
28
|
+
"-d",
|
|
29
|
+
options.outputFolder
|
|
30
|
+
]);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
if (err?.stderr.length > 0 && err?.exitCode !== 0) {
|
|
33
|
+
throw new Error(`Failed to package chart: ${err.stderr}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (output?.stderr.length > 0 && output?.exitCode !== 0) {
|
|
37
|
+
throw new Error(`Failed to package chart: ${output.stderr}`);
|
|
38
|
+
}
|
|
39
|
+
const match = output.stdout?.match(
|
|
40
|
+
/Successfully packaged chart and saved it to: (.+)/
|
|
41
|
+
);
|
|
42
|
+
if (!match || match.length < 2) {
|
|
43
|
+
throw new Error("Failed to parse chart path from helm output");
|
|
44
|
+
}
|
|
45
|
+
chartPath = match[1]?.trim();
|
|
46
|
+
return new Promise((resolve) => resolve(chartPath));
|
|
47
|
+
}
|
|
48
|
+
push(options) {
|
|
49
|
+
try {
|
|
50
|
+
this.runCommand(["helm", "push", options.chartPath, options.remote]);
|
|
51
|
+
} catch (err) {
|
|
52
|
+
if (err?.stderr.length > 0 && err?.exitCode !== 0) {
|
|
53
|
+
throw new Error(`Failed to push chart: ${err.stderr}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
dependencyUpdate(chartFolder) {
|
|
58
|
+
try {
|
|
59
|
+
this.runCommand(["helm", "dependency", "update", chartFolder]);
|
|
60
|
+
} catch (err) {
|
|
61
|
+
if (err?.stderr.length > 0 && err?.exitCode !== 0) {
|
|
62
|
+
throw new Error(`Failed to update chart dependencies: ${err.stderr}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
dependencyBuild(chartFolder) {
|
|
67
|
+
try {
|
|
68
|
+
this.runCommand(["helm", "dependency", "build", chartFolder]);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
if (err?.stderr.length > 0 && err?.exitCode !== 0) {
|
|
71
|
+
throw new Error(`Failed to build chart dependencies: ${err.stderr}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
addRepository(name, url) {
|
|
76
|
+
try {
|
|
77
|
+
this.runCommand(["helm", "repo", "add", name, url]);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
if (err?.stderr.length > 0 && err?.exitCode !== 0) {
|
|
80
|
+
throw new Error(`Failed to add repository: ${err.stderr}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Initialize Helm
|
|
86
|
+
*
|
|
87
|
+
* @returns A promise
|
|
88
|
+
*/
|
|
89
|
+
async initialize() {
|
|
90
|
+
if (this.initialized) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
this.runCommand(["helm", "version"]);
|
|
95
|
+
} catch (err) {
|
|
96
|
+
if (err?.stderr.length > 0 && err?.exitCode !== 0) {
|
|
97
|
+
throw new Error(`Helm is not installed: ${err.stderr}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return new Promise((resolve) => {
|
|
101
|
+
this.initialized = true;
|
|
102
|
+
resolve();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
runCommand(commands) {
|
|
106
|
+
return execSync(commands.filter(Boolean).join(" "), {
|
|
107
|
+
encoding: "utf8",
|
|
108
|
+
windowsHide: true,
|
|
109
|
+
maxBuffer: 1024 * 1e6,
|
|
110
|
+
stdio: "pipe"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
__decorateClass([
|
|
115
|
+
ensureInitialized
|
|
116
|
+
], HelmClient.prototype, "package", 1);
|
|
117
|
+
__decorateClass([
|
|
118
|
+
ensureInitialized
|
|
119
|
+
], HelmClient.prototype, "push", 1);
|
|
120
|
+
__decorateClass([
|
|
121
|
+
ensureInitialized
|
|
122
|
+
], HelmClient.prototype, "dependencyUpdate", 1);
|
|
123
|
+
__decorateClass([
|
|
124
|
+
ensureInitialized
|
|
125
|
+
], HelmClient.prototype, "dependencyBuild", 1);
|
|
126
|
+
__decorateClass([
|
|
127
|
+
ensureInitialized
|
|
128
|
+
], HelmClient.prototype, "addRepository", 1);
|
|
129
|
+
var createHelmClient = () => {
|
|
130
|
+
return new HelmClient();
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export {
|
|
134
|
+
HelmClient,
|
|
135
|
+
createHelmClient
|
|
136
|
+
};
|
|
@@ -15,7 +15,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
return result;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
18
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__544fc81e26f13ef0455e9a50e1cc2f07/node_modules/tsup/assets/esm_shims.js
|
|
19
19
|
import { fileURLToPath } from "url";
|
|
20
20
|
import path from "path";
|
|
21
21
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
var _chunkKBSSJUPWjs = require('./chunk-KBSSJUPW.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkC55DOLYTjs = require('./chunk-C55DOLYT.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkHDCLRS5Kjs = require('./chunk-HDCLRS5K.js');
|
|
11
11
|
|
|
12
12
|
// src/executors/container-publish/executor.ts
|
|
13
13
|
|
|
@@ -64,7 +64,7 @@ var applyWorkspaceExecutorTokens = async (option, tokenizerOptions) => {
|
|
|
64
64
|
if (result.includes("{workspaceRoot}")) {
|
|
65
65
|
result = result.replaceAll(
|
|
66
66
|
"{workspaceRoot}",
|
|
67
|
-
_nullishCoalesce(tokenizerOptions.workspaceRoot, () => (
|
|
67
|
+
_nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _chunkHDCLRS5Kjs.findWorkspaceRoot.call(void 0, )))
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
return result;
|
|
@@ -80,8 +80,8 @@ async function* publishExecutor(options, context) {
|
|
|
80
80
|
console.info(
|
|
81
81
|
`\u{1F680} Running Storm Container Registry Publish executor on the ${context.projectName} crate`
|
|
82
82
|
);
|
|
83
|
-
const workspaceRoot =
|
|
84
|
-
const config = await
|
|
83
|
+
const workspaceRoot = _chunkHDCLRS5Kjs.findWorkspaceRoot.call(void 0, );
|
|
84
|
+
const config = await _chunkHDCLRS5Kjs.getConfig.call(void 0, workspaceRoot);
|
|
85
85
|
const projectConfig = _optionalChain([context, 'access', _2 => _2.projectsConfigurations, 'optionalAccess', _3 => _3.projects, 'access', _4 => _4[context.projectName]]);
|
|
86
86
|
if (!projectConfig) {
|
|
87
87
|
throw new Error(
|
|
@@ -92,7 +92,7 @@ async function* publishExecutor(options, context) {
|
|
|
92
92
|
const sourceRoot = _nullishCoalesce(_optionalChain([projectConfig, 'optionalAccess', _6 => _6.sourceRoot]), () => ( workspaceRoot));
|
|
93
93
|
const projectName = _nullishCoalesce(_optionalChain([projectConfig, 'optionalAccess', _7 => _7.name]), () => ( context.projectName));
|
|
94
94
|
config.workspaceRoot = workspaceRoot;
|
|
95
|
-
const tokenized = await
|
|
95
|
+
const tokenized = await _chunkC55DOLYTjs.applyWorkspaceTokens.call(void 0,
|
|
96
96
|
options,
|
|
97
97
|
{
|
|
98
98
|
config,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkDVCZGSQUjs = require('./chunk-DVCZGSQU.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkHDCLRS5Kjs = require('./chunk-HDCLRS5K.js');
|
|
7
7
|
|
|
8
8
|
// src/generators/helm-chart/generator.ts
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@ var _chunkEA47D42Rjs = require('./chunk-EA47D42R.js');
|
|
|
14
14
|
var _devkit = require('@nx/devkit');
|
|
15
15
|
var _path = require('path');
|
|
16
16
|
async function helmChartGeneratorFn(tree, options, config) {
|
|
17
|
-
|
|
17
|
+
_chunkHDCLRS5Kjs.writeDebug.call(void 0, "\u{1F4DD} Preparing to write Helm Chart", config);
|
|
18
18
|
const project = _devkit.readProjectConfiguration.call(void 0, tree, options.project);
|
|
19
19
|
if (_optionalChain([project, 'access', _ => _.targets, 'optionalAccess', _2 => _2["helm-package"]])) {
|
|
20
20
|
throw new Error(
|
|
@@ -55,7 +55,7 @@ async function helmChartGeneratorFn(tree, options, config) {
|
|
|
55
55
|
success: true
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
var generator_default =
|
|
58
|
+
var generator_default = _chunkDVCZGSQUjs.withRunGenerator.call(void 0,
|
|
59
59
|
"Helm Chart",
|
|
60
60
|
helmChartGeneratorFn
|
|
61
61
|
);
|
package/dist/executors.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-XO66D74Z.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkX6ZEMTJIjs = require('./chunk-X6ZEMTJI.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkF2HUPD62js = require('./chunk-F2HUPD62.js');
|
|
8
8
|
require('./chunk-KBSSJUPW.js');
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-C55DOLYT.js');
|
|
10
|
+
require('./chunk-HDCLRS5K.js');
|
|
11
11
|
require('./chunk-4AADQIGW.js');
|
|
12
12
|
require('./chunk-JSFRUBG5.js');
|
|
13
13
|
require('./chunk-XKOZIQT3.js');
|
|
@@ -15,4 +15,4 @@ require('./chunk-RECJ3G6F.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.getRegistryVersion =
|
|
18
|
+
exports.getRegistryVersion = _chunkX6ZEMTJIjs.getRegistryVersion; exports.serveExecutor = _chunkF2HUPD62js.serveExecutor;
|