@storm-software/k8s-tools 0.0.1
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/LICENSE +201 -0
- package/README.md +7 -0
- package/executors.json +9 -0
- package/generators.json +14 -0
- package/index.js +4109 -0
- package/meta.json +1 -0
- package/package.json +71 -0
- package/packages/build-tools/src/build/index.d.ts +3 -0
- package/packages/build-tools/src/build/rolldown.d.ts +20 -0
- package/packages/build-tools/src/build/ts-build.d.ts +20 -0
- package/packages/build-tools/src/build/unbuild.d.ts +20 -0
- package/packages/build-tools/src/cli/index.d.ts +2 -0
- package/packages/build-tools/src/config/browser-config.d.ts +2 -0
- package/packages/build-tools/src/config/default-config.d.ts +2 -0
- package/packages/build-tools/src/config/get-config.d.ts +2 -0
- package/packages/build-tools/src/config/get-rolldown-config.d.ts +6 -0
- package/packages/build-tools/src/config/get-unbuild-config.d.ts +6 -0
- package/packages/build-tools/src/config/index.d.ts +7 -0
- package/packages/build-tools/src/config/neutral-config.d.ts +2 -0
- package/packages/build-tools/src/config/node-config.d.ts +3 -0
- package/packages/build-tools/src/index.d.ts +6 -0
- package/packages/build-tools/src/plugins/analyze-plugin.d.ts +4 -0
- package/packages/build-tools/src/plugins/index.d.ts +4 -0
- package/packages/build-tools/src/plugins/swc-plugin.d.ts +2 -0
- package/packages/build-tools/src/plugins/ts-resolve.d.ts +6 -0
- package/packages/build-tools/src/plugins/type-definitions.d.ts +7 -0
- package/packages/build-tools/src/types.d.ts +213 -0
- package/packages/build-tools/src/utils/apply-default-options.d.ts +6 -0
- package/packages/build-tools/src/utils/generate-package-json.d.ts +7 -0
- package/packages/build-tools/src/utils/get-entry-points.d.ts +3 -0
- package/packages/build-tools/src/utils/get-file-banner.d.ts +8 -0
- package/packages/build-tools/src/utils/get-project-deps.d.ts +5 -0
- package/packages/build-tools/src/utils/index.d.ts +7 -0
- package/packages/build-tools/src/utils/out-extension.d.ts +8 -0
- package/packages/build-tools/src/utils/run-tsup-build.d.ts +3 -0
- package/packages/build-tools/src/utils/task-graph.d.ts +6 -0
- package/packages/config/src/constants.d.ts +3 -0
- package/packages/config/src/define-config.d.ts +174 -0
- package/packages/config/src/index.d.ts +12 -0
- package/packages/config/src/schema.d.ts +1915 -0
- package/packages/config/src/types.d.ts +23 -0
- package/packages/config-tools/src/config-file/get-config-file.d.ts +16 -0
- package/packages/config-tools/src/config-file/index.d.ts +1 -0
- package/packages/config-tools/src/create-storm-config.d.ts +26 -0
- package/packages/config-tools/src/env/get-env.d.ts +15 -0
- package/packages/config-tools/src/env/index.d.ts +2 -0
- package/packages/config-tools/src/env/set-env.d.ts +14 -0
- package/packages/config-tools/src/index.d.ts +13 -0
- package/packages/config-tools/src/types.d.ts +33 -0
- package/packages/config-tools/src/utilities/apply-workspace-tokens.d.ts +4 -0
- package/packages/config-tools/src/utilities/chalk.d.ts +23 -0
- package/packages/config-tools/src/utilities/correct-paths.d.ts +1 -0
- package/packages/config-tools/src/utilities/file-path-utils.d.ts +2 -0
- package/packages/config-tools/src/utilities/find-up.d.ts +4 -0
- package/packages/config-tools/src/utilities/find-workspace-root.d.ts +14 -0
- package/packages/config-tools/src/utilities/get-default-config.d.ts +15 -0
- package/packages/config-tools/src/utilities/get-log-level.d.ts +15 -0
- package/packages/config-tools/src/utilities/index.d.ts +10 -0
- package/packages/config-tools/src/utilities/logger.d.ts +74 -0
- package/packages/config-tools/src/utilities/process-handler.d.ts +4 -0
- package/packages/config-tools/src/utilities/run.d.ts +18 -0
- package/packages/k8s-tools/index.d.ts +1 -0
- package/packages/k8s-tools/src/executors/helm-package/executor.d.ts +8 -0
- package/packages/k8s-tools/src/executors/index.d.ts +1 -0
- package/packages/k8s-tools/src/generators/helm-chart/generator.d.ts +5 -0
- package/packages/k8s-tools/src/generators/helm-dependency/generator.d.ts +5 -0
- package/packages/k8s-tools/src/generators/index.d.ts +2 -0
- package/packages/k8s-tools/src/index.d.ts +2 -0
- package/packages/k8s-tools/src/types.d.ts +28 -0
- package/packages/k8s-tools/src/utils/client.d.ts +26 -0
- package/packages/k8s-tools/src/utils/ensure-init.d.ts +9 -0
- package/packages/k8s-tools/src/utils/prettier.d.ts +9 -0
- package/packages/workspace-tools/index.d.ts +32 -0
- package/packages/workspace-tools/src/base/base-executor.d.ts +7 -0
- package/packages/workspace-tools/src/base/base-generator.d.ts +4 -0
- package/packages/workspace-tools/src/base/index.d.ts +3 -0
- package/packages/workspace-tools/src/base/typescript-library-generator.d.ts +8 -0
- package/packages/workspace-tools/src/executors/cargo-publish/executor.d.ts +6 -0
- package/packages/workspace-tools/src/executors/clean-package/constants.d.ts +4 -0
- package/packages/workspace-tools/src/executors/clean-package/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/clean-package/types.d.ts +8 -0
- package/packages/workspace-tools/src/executors/clean-package/utils.d.ts +4 -0
- package/packages/workspace-tools/src/executors/npm-publish/executor.d.ts +6 -0
- package/packages/workspace-tools/src/executors/rolldown/executor.d.ts +9 -0
- package/packages/workspace-tools/src/executors/size-limit/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/tsup/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/tsup-browser/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/tsup-neutral/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/tsup-node/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/typia/executor.d.ts +8 -0
- package/packages/workspace-tools/src/executors/unbuild/executor.d.ts +9 -0
- package/packages/workspace-tools/src/generators/config-schema/generator.d.ts +13 -0
- package/packages/workspace-tools/src/generators/init/init.d.ts +4 -0
- package/packages/workspace-tools/src/generators/node-library/generator.d.ts +5 -0
- package/packages/workspace-tools/src/generators/preset/generator.d.ts +5 -0
- package/packages/workspace-tools/src/generators/release-version/generator.d.ts +13 -0
- package/packages/workspace-tools/src/utils/apply-workspace-tokens.d.ts +8 -0
- package/packages/workspace-tools/src/utils/cargo.d.ts +26 -0
- package/packages/workspace-tools/src/utils/create-cli-options.d.ts +1 -0
- package/packages/workspace-tools/src/utils/get-project-configurations.d.ts +13 -0
- package/packages/workspace-tools/src/utils/index.d.ts +9 -0
- package/packages/workspace-tools/src/utils/lock-file.d.ts +23 -0
- package/packages/workspace-tools/src/utils/project-tags.d.ts +30 -0
- package/packages/workspace-tools/src/utils/toml.d.ts +167 -0
- package/packages/workspace-tools/src/utils/typia-transform.d.ts +2 -0
- package/packages/workspace-tools/src/utils/versions.d.ts +18 -0
- package/src/executors/helm-package/executor.js +1244 -0
- package/src/executors/helm-package/schema.d.ts +29 -0
- package/src/executors/helm-package/schema.json +112 -0
- package/src/generators/helm-chart/files/chart/.helmignore +23 -0
- package/src/generators/helm-chart/files/chart/Chart.yaml.template +6 -0
- package/src/generators/helm-chart/files/chart/templates/NOTES.txt +22 -0
- package/src/generators/helm-chart/files/chart/templates/_helpers.yaml +62 -0
- package/src/generators/helm-chart/files/chart/templates/deployment.yaml +68 -0
- package/src/generators/helm-chart/files/chart/templates/hpa.yaml +32 -0
- package/src/generators/helm-chart/files/chart/templates/ingress.yaml +61 -0
- package/src/generators/helm-chart/files/chart/templates/service.yaml +13 -0
- package/src/generators/helm-chart/files/chart/templates/serviceaccount.yaml +13 -0
- package/src/generators/helm-chart/files/chart/templates/test/test-connection.yaml +15 -0
- package/src/generators/helm-chart/files/chart/values.yaml +111 -0
- package/src/generators/helm-chart/generator.js +131 -0
- package/src/generators/helm-chart/schema.d.ts +11 -0
- package/src/generators/helm-chart/schema.json +48 -0
- package/src/generators/helm-dependency/generator.js +2805 -0
- package/src/generators/helm-dependency/schema.d.ts +15 -0
- package/src/generators/helm-dependency/schema.json +71 -0
|
@@ -0,0 +1,1244 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
32
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
33
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
34
|
+
if (decorator = decorators[i])
|
|
35
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
36
|
+
if (kind && result) __defProp(target, key, result);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io-util.js
|
|
41
|
+
var require_io_util = __commonJS({
|
|
42
|
+
"node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io-util.js"(exports2) {
|
|
43
|
+
"use strict";
|
|
44
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
45
|
+
if (k2 === void 0) k2 = k;
|
|
46
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
47
|
+
return m[k];
|
|
48
|
+
} });
|
|
49
|
+
} : function(o, m, k, k2) {
|
|
50
|
+
if (k2 === void 0) k2 = k;
|
|
51
|
+
o[k2] = m[k];
|
|
52
|
+
});
|
|
53
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
54
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
55
|
+
} : function(o, v) {
|
|
56
|
+
o["default"] = v;
|
|
57
|
+
});
|
|
58
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
59
|
+
if (mod && mod.__esModule) return mod;
|
|
60
|
+
var result = {};
|
|
61
|
+
if (mod != null) {
|
|
62
|
+
for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
63
|
+
}
|
|
64
|
+
__setModuleDefault(result, mod);
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
68
|
+
function adopt(value) {
|
|
69
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
70
|
+
resolve(value);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
74
|
+
function fulfilled(value) {
|
|
75
|
+
try {
|
|
76
|
+
step(generator.next(value));
|
|
77
|
+
} catch (e) {
|
|
78
|
+
reject(e);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function rejected(value) {
|
|
82
|
+
try {
|
|
83
|
+
step(generator["throw"](value));
|
|
84
|
+
} catch (e) {
|
|
85
|
+
reject(e);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function step(result) {
|
|
89
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
90
|
+
}
|
|
91
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
var _a;
|
|
95
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
96
|
+
exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readlink = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0;
|
|
97
|
+
var fs = __importStar(require("fs"));
|
|
98
|
+
var path = __importStar(require("path"));
|
|
99
|
+
_a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink;
|
|
100
|
+
exports2.IS_WINDOWS = process.platform === "win32";
|
|
101
|
+
exports2.UV_FS_O_EXLOCK = 268435456;
|
|
102
|
+
exports2.READONLY = fs.constants.O_RDONLY;
|
|
103
|
+
function exists(fsPath) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
try {
|
|
106
|
+
yield exports2.stat(fsPath);
|
|
107
|
+
} catch (err) {
|
|
108
|
+
if (err.code === "ENOENT") {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
throw err;
|
|
112
|
+
}
|
|
113
|
+
return true;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
exports2.exists = exists;
|
|
117
|
+
function isDirectory(fsPath, useStat = false) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath);
|
|
120
|
+
return stats.isDirectory();
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
exports2.isDirectory = isDirectory;
|
|
124
|
+
function isRooted(p) {
|
|
125
|
+
p = normalizeSeparators(p);
|
|
126
|
+
if (!p) {
|
|
127
|
+
throw new Error('isRooted() parameter "p" cannot be empty');
|
|
128
|
+
}
|
|
129
|
+
if (exports2.IS_WINDOWS) {
|
|
130
|
+
return p.startsWith("\\") || /^[A-Z]:/i.test(p);
|
|
131
|
+
}
|
|
132
|
+
return p.startsWith("/");
|
|
133
|
+
}
|
|
134
|
+
exports2.isRooted = isRooted;
|
|
135
|
+
function tryGetExecutablePath(filePath, extensions) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
let stats = void 0;
|
|
138
|
+
try {
|
|
139
|
+
stats = yield exports2.stat(filePath);
|
|
140
|
+
} catch (err) {
|
|
141
|
+
if (err.code !== "ENOENT") {
|
|
142
|
+
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (stats && stats.isFile()) {
|
|
146
|
+
if (exports2.IS_WINDOWS) {
|
|
147
|
+
const upperExt = path.extname(filePath).toUpperCase();
|
|
148
|
+
if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) {
|
|
149
|
+
return filePath;
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
if (isUnixExecutable(stats)) {
|
|
153
|
+
return filePath;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const originalFilePath = filePath;
|
|
158
|
+
for (const extension of extensions) {
|
|
159
|
+
filePath = originalFilePath + extension;
|
|
160
|
+
stats = void 0;
|
|
161
|
+
try {
|
|
162
|
+
stats = yield exports2.stat(filePath);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
if (err.code !== "ENOENT") {
|
|
165
|
+
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (stats && stats.isFile()) {
|
|
169
|
+
if (exports2.IS_WINDOWS) {
|
|
170
|
+
try {
|
|
171
|
+
const directory = path.dirname(filePath);
|
|
172
|
+
const upperName = path.basename(filePath).toUpperCase();
|
|
173
|
+
for (const actualName of yield exports2.readdir(directory)) {
|
|
174
|
+
if (upperName === actualName.toUpperCase()) {
|
|
175
|
+
filePath = path.join(directory, actualName);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
} catch (err) {
|
|
180
|
+
console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
|
|
181
|
+
}
|
|
182
|
+
return filePath;
|
|
183
|
+
} else {
|
|
184
|
+
if (isUnixExecutable(stats)) {
|
|
185
|
+
return filePath;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return "";
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
exports2.tryGetExecutablePath = tryGetExecutablePath;
|
|
194
|
+
function normalizeSeparators(p) {
|
|
195
|
+
p = p || "";
|
|
196
|
+
if (exports2.IS_WINDOWS) {
|
|
197
|
+
p = p.replace(/\//g, "\\");
|
|
198
|
+
return p.replace(/\\\\+/g, "\\");
|
|
199
|
+
}
|
|
200
|
+
return p.replace(/\/\/+/g, "/");
|
|
201
|
+
}
|
|
202
|
+
function isUnixExecutable(stats) {
|
|
203
|
+
return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && stats.uid === process.getuid();
|
|
204
|
+
}
|
|
205
|
+
function getCmdPath() {
|
|
206
|
+
var _a2;
|
|
207
|
+
return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`;
|
|
208
|
+
}
|
|
209
|
+
exports2.getCmdPath = getCmdPath;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io.js
|
|
214
|
+
var require_io = __commonJS({
|
|
215
|
+
"node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io.js"(exports2) {
|
|
216
|
+
"use strict";
|
|
217
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
218
|
+
if (k2 === void 0) k2 = k;
|
|
219
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
220
|
+
return m[k];
|
|
221
|
+
} });
|
|
222
|
+
} : function(o, m, k, k2) {
|
|
223
|
+
if (k2 === void 0) k2 = k;
|
|
224
|
+
o[k2] = m[k];
|
|
225
|
+
});
|
|
226
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
227
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
228
|
+
} : function(o, v) {
|
|
229
|
+
o["default"] = v;
|
|
230
|
+
});
|
|
231
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
232
|
+
if (mod && mod.__esModule) return mod;
|
|
233
|
+
var result = {};
|
|
234
|
+
if (mod != null) {
|
|
235
|
+
for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
236
|
+
}
|
|
237
|
+
__setModuleDefault(result, mod);
|
|
238
|
+
return result;
|
|
239
|
+
};
|
|
240
|
+
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
241
|
+
function adopt(value) {
|
|
242
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
243
|
+
resolve(value);
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
247
|
+
function fulfilled(value) {
|
|
248
|
+
try {
|
|
249
|
+
step(generator.next(value));
|
|
250
|
+
} catch (e) {
|
|
251
|
+
reject(e);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function rejected(value) {
|
|
255
|
+
try {
|
|
256
|
+
step(generator["throw"](value));
|
|
257
|
+
} catch (e) {
|
|
258
|
+
reject(e);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function step(result) {
|
|
262
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
263
|
+
}
|
|
264
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
268
|
+
exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0;
|
|
269
|
+
var assert_1 = require("assert");
|
|
270
|
+
var path = __importStar(require("path"));
|
|
271
|
+
var ioUtil = __importStar(require_io_util());
|
|
272
|
+
function cp(source, dest, options = {}) {
|
|
273
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
274
|
+
const { force, recursive, copySourceDirectory } = readCopyOptions(options);
|
|
275
|
+
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
|
|
276
|
+
if (destStat && destStat.isFile() && !force) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path.join(dest, path.basename(source)) : dest;
|
|
280
|
+
if (!(yield ioUtil.exists(source))) {
|
|
281
|
+
throw new Error(`no such file or directory: ${source}`);
|
|
282
|
+
}
|
|
283
|
+
const sourceStat = yield ioUtil.stat(source);
|
|
284
|
+
if (sourceStat.isDirectory()) {
|
|
285
|
+
if (!recursive) {
|
|
286
|
+
throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
|
|
287
|
+
} else {
|
|
288
|
+
yield cpDirRecursive(source, newDest, 0, force);
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
if (path.relative(source, newDest) === "") {
|
|
292
|
+
throw new Error(`'${newDest}' and '${source}' are the same file`);
|
|
293
|
+
}
|
|
294
|
+
yield copyFile(source, newDest, force);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
exports2.cp = cp;
|
|
299
|
+
function mv(source, dest, options = {}) {
|
|
300
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
if (yield ioUtil.exists(dest)) {
|
|
302
|
+
let destExists = true;
|
|
303
|
+
if (yield ioUtil.isDirectory(dest)) {
|
|
304
|
+
dest = path.join(dest, path.basename(source));
|
|
305
|
+
destExists = yield ioUtil.exists(dest);
|
|
306
|
+
}
|
|
307
|
+
if (destExists) {
|
|
308
|
+
if (options.force == null || options.force) {
|
|
309
|
+
yield rmRF(dest);
|
|
310
|
+
} else {
|
|
311
|
+
throw new Error("Destination already exists");
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
yield mkdirP(path.dirname(dest));
|
|
316
|
+
yield ioUtil.rename(source, dest);
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
exports2.mv = mv;
|
|
320
|
+
function rmRF(inputPath) {
|
|
321
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
322
|
+
if (ioUtil.IS_WINDOWS) {
|
|
323
|
+
if (/[*"<>|]/.test(inputPath)) {
|
|
324
|
+
throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
try {
|
|
328
|
+
yield ioUtil.rm(inputPath, {
|
|
329
|
+
force: true,
|
|
330
|
+
maxRetries: 3,
|
|
331
|
+
recursive: true,
|
|
332
|
+
retryDelay: 300
|
|
333
|
+
});
|
|
334
|
+
} catch (err) {
|
|
335
|
+
throw new Error(`File was unable to be removed ${err}`);
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
exports2.rmRF = rmRF;
|
|
340
|
+
function mkdirP(fsPath) {
|
|
341
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
342
|
+
assert_1.ok(fsPath, "a path argument must be provided");
|
|
343
|
+
yield ioUtil.mkdir(fsPath, { recursive: true });
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
exports2.mkdirP = mkdirP;
|
|
347
|
+
function which(tool, check) {
|
|
348
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
349
|
+
if (!tool) {
|
|
350
|
+
throw new Error("parameter 'tool' is required");
|
|
351
|
+
}
|
|
352
|
+
if (check) {
|
|
353
|
+
const result = yield which(tool, false);
|
|
354
|
+
if (!result) {
|
|
355
|
+
if (ioUtil.IS_WINDOWS) {
|
|
356
|
+
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
|
|
357
|
+
} else {
|
|
358
|
+
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return result;
|
|
362
|
+
}
|
|
363
|
+
const matches = yield findInPath(tool);
|
|
364
|
+
if (matches && matches.length > 0) {
|
|
365
|
+
return matches[0];
|
|
366
|
+
}
|
|
367
|
+
return "";
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
exports2.which = which;
|
|
371
|
+
function findInPath(tool) {
|
|
372
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
373
|
+
if (!tool) {
|
|
374
|
+
throw new Error("parameter 'tool' is required");
|
|
375
|
+
}
|
|
376
|
+
const extensions = [];
|
|
377
|
+
if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) {
|
|
378
|
+
for (const extension of process.env["PATHEXT"].split(path.delimiter)) {
|
|
379
|
+
if (extension) {
|
|
380
|
+
extensions.push(extension);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (ioUtil.isRooted(tool)) {
|
|
385
|
+
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
|
386
|
+
if (filePath) {
|
|
387
|
+
return [filePath];
|
|
388
|
+
}
|
|
389
|
+
return [];
|
|
390
|
+
}
|
|
391
|
+
if (tool.includes(path.sep)) {
|
|
392
|
+
return [];
|
|
393
|
+
}
|
|
394
|
+
const directories = [];
|
|
395
|
+
if (process.env.PATH) {
|
|
396
|
+
for (const p of process.env.PATH.split(path.delimiter)) {
|
|
397
|
+
if (p) {
|
|
398
|
+
directories.push(p);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
const matches = [];
|
|
403
|
+
for (const directory of directories) {
|
|
404
|
+
const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
|
|
405
|
+
if (filePath) {
|
|
406
|
+
matches.push(filePath);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return matches;
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
exports2.findInPath = findInPath;
|
|
413
|
+
function readCopyOptions(options) {
|
|
414
|
+
const force = options.force == null ? true : options.force;
|
|
415
|
+
const recursive = Boolean(options.recursive);
|
|
416
|
+
const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory);
|
|
417
|
+
return { force, recursive, copySourceDirectory };
|
|
418
|
+
}
|
|
419
|
+
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
|
|
420
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
421
|
+
if (currentDepth >= 255)
|
|
422
|
+
return;
|
|
423
|
+
currentDepth++;
|
|
424
|
+
yield mkdirP(destDir);
|
|
425
|
+
const files = yield ioUtil.readdir(sourceDir);
|
|
426
|
+
for (const fileName of files) {
|
|
427
|
+
const srcFile = `${sourceDir}/${fileName}`;
|
|
428
|
+
const destFile = `${destDir}/${fileName}`;
|
|
429
|
+
const srcFileStat = yield ioUtil.lstat(srcFile);
|
|
430
|
+
if (srcFileStat.isDirectory()) {
|
|
431
|
+
yield cpDirRecursive(srcFile, destFile, currentDepth, force);
|
|
432
|
+
} else {
|
|
433
|
+
yield copyFile(srcFile, destFile, force);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
function copyFile(srcFile, destFile, force) {
|
|
440
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
441
|
+
if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
|
|
442
|
+
try {
|
|
443
|
+
yield ioUtil.lstat(destFile);
|
|
444
|
+
yield ioUtil.unlink(destFile);
|
|
445
|
+
} catch (e) {
|
|
446
|
+
if (e.code === "EPERM") {
|
|
447
|
+
yield ioUtil.chmod(destFile, "0666");
|
|
448
|
+
yield ioUtil.unlink(destFile);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
const symlinkFull = yield ioUtil.readlink(srcFile);
|
|
452
|
+
yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? "junction" : null);
|
|
453
|
+
} else if (!(yield ioUtil.exists(destFile)) || force) {
|
|
454
|
+
yield ioUtil.copyFile(srcFile, destFile);
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
// node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/toolrunner.js
|
|
462
|
+
var require_toolrunner = __commonJS({
|
|
463
|
+
"node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/toolrunner.js"(exports2) {
|
|
464
|
+
"use strict";
|
|
465
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
466
|
+
if (k2 === void 0) k2 = k;
|
|
467
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
468
|
+
return m[k];
|
|
469
|
+
} });
|
|
470
|
+
} : function(o, m, k, k2) {
|
|
471
|
+
if (k2 === void 0) k2 = k;
|
|
472
|
+
o[k2] = m[k];
|
|
473
|
+
});
|
|
474
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
475
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
476
|
+
} : function(o, v) {
|
|
477
|
+
o["default"] = v;
|
|
478
|
+
});
|
|
479
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
480
|
+
if (mod && mod.__esModule) return mod;
|
|
481
|
+
var result = {};
|
|
482
|
+
if (mod != null) {
|
|
483
|
+
for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
484
|
+
}
|
|
485
|
+
__setModuleDefault(result, mod);
|
|
486
|
+
return result;
|
|
487
|
+
};
|
|
488
|
+
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
489
|
+
function adopt(value) {
|
|
490
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
491
|
+
resolve(value);
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
495
|
+
function fulfilled(value) {
|
|
496
|
+
try {
|
|
497
|
+
step(generator.next(value));
|
|
498
|
+
} catch (e) {
|
|
499
|
+
reject(e);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function rejected(value) {
|
|
503
|
+
try {
|
|
504
|
+
step(generator["throw"](value));
|
|
505
|
+
} catch (e) {
|
|
506
|
+
reject(e);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
function step(result) {
|
|
510
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
511
|
+
}
|
|
512
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
513
|
+
});
|
|
514
|
+
};
|
|
515
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
516
|
+
exports2.argStringToArray = exports2.ToolRunner = void 0;
|
|
517
|
+
var os = __importStar(require("os"));
|
|
518
|
+
var events = __importStar(require("events"));
|
|
519
|
+
var child = __importStar(require("child_process"));
|
|
520
|
+
var path = __importStar(require("path"));
|
|
521
|
+
var io = __importStar(require_io());
|
|
522
|
+
var ioUtil = __importStar(require_io_util());
|
|
523
|
+
var timers_1 = require("timers");
|
|
524
|
+
var IS_WINDOWS = process.platform === "win32";
|
|
525
|
+
var ToolRunner = class extends events.EventEmitter {
|
|
526
|
+
constructor(toolPath, args, options) {
|
|
527
|
+
super();
|
|
528
|
+
if (!toolPath) {
|
|
529
|
+
throw new Error("Parameter 'toolPath' cannot be null or empty.");
|
|
530
|
+
}
|
|
531
|
+
this.toolPath = toolPath;
|
|
532
|
+
this.args = args || [];
|
|
533
|
+
this.options = options || {};
|
|
534
|
+
}
|
|
535
|
+
_debug(message) {
|
|
536
|
+
if (this.options.listeners && this.options.listeners.debug) {
|
|
537
|
+
this.options.listeners.debug(message);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
_getCommandString(options, noPrefix) {
|
|
541
|
+
const toolPath = this._getSpawnFileName();
|
|
542
|
+
const args = this._getSpawnArgs(options);
|
|
543
|
+
let cmd = noPrefix ? "" : "[command]";
|
|
544
|
+
if (IS_WINDOWS) {
|
|
545
|
+
if (this._isCmdFile()) {
|
|
546
|
+
cmd += toolPath;
|
|
547
|
+
for (const a of args) {
|
|
548
|
+
cmd += ` ${a}`;
|
|
549
|
+
}
|
|
550
|
+
} else if (options.windowsVerbatimArguments) {
|
|
551
|
+
cmd += `"${toolPath}"`;
|
|
552
|
+
for (const a of args) {
|
|
553
|
+
cmd += ` ${a}`;
|
|
554
|
+
}
|
|
555
|
+
} else {
|
|
556
|
+
cmd += this._windowsQuoteCmdArg(toolPath);
|
|
557
|
+
for (const a of args) {
|
|
558
|
+
cmd += ` ${this._windowsQuoteCmdArg(a)}`;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
} else {
|
|
562
|
+
cmd += toolPath;
|
|
563
|
+
for (const a of args) {
|
|
564
|
+
cmd += ` ${a}`;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return cmd;
|
|
568
|
+
}
|
|
569
|
+
_processLineBuffer(data, strBuffer, onLine) {
|
|
570
|
+
try {
|
|
571
|
+
let s = strBuffer + data.toString();
|
|
572
|
+
let n = s.indexOf(os.EOL);
|
|
573
|
+
while (n > -1) {
|
|
574
|
+
const line = s.substring(0, n);
|
|
575
|
+
onLine(line);
|
|
576
|
+
s = s.substring(n + os.EOL.length);
|
|
577
|
+
n = s.indexOf(os.EOL);
|
|
578
|
+
}
|
|
579
|
+
return s;
|
|
580
|
+
} catch (err) {
|
|
581
|
+
this._debug(`error processing line. Failed with error ${err}`);
|
|
582
|
+
return "";
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
_getSpawnFileName() {
|
|
586
|
+
if (IS_WINDOWS) {
|
|
587
|
+
if (this._isCmdFile()) {
|
|
588
|
+
return process.env["COMSPEC"] || "cmd.exe";
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
return this.toolPath;
|
|
592
|
+
}
|
|
593
|
+
_getSpawnArgs(options) {
|
|
594
|
+
if (IS_WINDOWS) {
|
|
595
|
+
if (this._isCmdFile()) {
|
|
596
|
+
let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
|
|
597
|
+
for (const a of this.args) {
|
|
598
|
+
argline += " ";
|
|
599
|
+
argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a);
|
|
600
|
+
}
|
|
601
|
+
argline += '"';
|
|
602
|
+
return [argline];
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return this.args;
|
|
606
|
+
}
|
|
607
|
+
_endsWith(str, end) {
|
|
608
|
+
return str.endsWith(end);
|
|
609
|
+
}
|
|
610
|
+
_isCmdFile() {
|
|
611
|
+
const upperToolPath = this.toolPath.toUpperCase();
|
|
612
|
+
return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT");
|
|
613
|
+
}
|
|
614
|
+
_windowsQuoteCmdArg(arg) {
|
|
615
|
+
if (!this._isCmdFile()) {
|
|
616
|
+
return this._uvQuoteCmdArg(arg);
|
|
617
|
+
}
|
|
618
|
+
if (!arg) {
|
|
619
|
+
return '""';
|
|
620
|
+
}
|
|
621
|
+
const cmdSpecialChars = [
|
|
622
|
+
" ",
|
|
623
|
+
" ",
|
|
624
|
+
"&",
|
|
625
|
+
"(",
|
|
626
|
+
")",
|
|
627
|
+
"[",
|
|
628
|
+
"]",
|
|
629
|
+
"{",
|
|
630
|
+
"}",
|
|
631
|
+
"^",
|
|
632
|
+
"=",
|
|
633
|
+
";",
|
|
634
|
+
"!",
|
|
635
|
+
"'",
|
|
636
|
+
"+",
|
|
637
|
+
",",
|
|
638
|
+
"`",
|
|
639
|
+
"~",
|
|
640
|
+
"|",
|
|
641
|
+
"<",
|
|
642
|
+
">",
|
|
643
|
+
'"'
|
|
644
|
+
];
|
|
645
|
+
let needsQuotes = false;
|
|
646
|
+
for (const char of arg) {
|
|
647
|
+
if (cmdSpecialChars.some((x) => x === char)) {
|
|
648
|
+
needsQuotes = true;
|
|
649
|
+
break;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
if (!needsQuotes) {
|
|
653
|
+
return arg;
|
|
654
|
+
}
|
|
655
|
+
let reverse = '"';
|
|
656
|
+
let quoteHit = true;
|
|
657
|
+
for (let i = arg.length; i > 0; i--) {
|
|
658
|
+
reverse += arg[i - 1];
|
|
659
|
+
if (quoteHit && arg[i - 1] === "\\") {
|
|
660
|
+
reverse += "\\";
|
|
661
|
+
} else if (arg[i - 1] === '"') {
|
|
662
|
+
quoteHit = true;
|
|
663
|
+
reverse += '"';
|
|
664
|
+
} else {
|
|
665
|
+
quoteHit = false;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
reverse += '"';
|
|
669
|
+
return reverse.split("").reverse().join("");
|
|
670
|
+
}
|
|
671
|
+
_uvQuoteCmdArg(arg) {
|
|
672
|
+
if (!arg) {
|
|
673
|
+
return '""';
|
|
674
|
+
}
|
|
675
|
+
if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) {
|
|
676
|
+
return arg;
|
|
677
|
+
}
|
|
678
|
+
if (!arg.includes('"') && !arg.includes("\\")) {
|
|
679
|
+
return `"${arg}"`;
|
|
680
|
+
}
|
|
681
|
+
let reverse = '"';
|
|
682
|
+
let quoteHit = true;
|
|
683
|
+
for (let i = arg.length; i > 0; i--) {
|
|
684
|
+
reverse += arg[i - 1];
|
|
685
|
+
if (quoteHit && arg[i - 1] === "\\") {
|
|
686
|
+
reverse += "\\";
|
|
687
|
+
} else if (arg[i - 1] === '"') {
|
|
688
|
+
quoteHit = true;
|
|
689
|
+
reverse += "\\";
|
|
690
|
+
} else {
|
|
691
|
+
quoteHit = false;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
reverse += '"';
|
|
695
|
+
return reverse.split("").reverse().join("");
|
|
696
|
+
}
|
|
697
|
+
_cloneExecOptions(options) {
|
|
698
|
+
options = options || {};
|
|
699
|
+
const result = {
|
|
700
|
+
cwd: options.cwd || process.cwd(),
|
|
701
|
+
env: options.env || process.env,
|
|
702
|
+
silent: options.silent || false,
|
|
703
|
+
windowsVerbatimArguments: options.windowsVerbatimArguments || false,
|
|
704
|
+
failOnStdErr: options.failOnStdErr || false,
|
|
705
|
+
ignoreReturnCode: options.ignoreReturnCode || false,
|
|
706
|
+
delay: options.delay || 1e4
|
|
707
|
+
};
|
|
708
|
+
result.outStream = options.outStream || process.stdout;
|
|
709
|
+
result.errStream = options.errStream || process.stderr;
|
|
710
|
+
return result;
|
|
711
|
+
}
|
|
712
|
+
_getSpawnOptions(options, toolPath) {
|
|
713
|
+
options = options || {};
|
|
714
|
+
const result = {};
|
|
715
|
+
result.cwd = options.cwd;
|
|
716
|
+
result.env = options.env;
|
|
717
|
+
result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile();
|
|
718
|
+
if (options.windowsVerbatimArguments) {
|
|
719
|
+
result.argv0 = `"${toolPath}"`;
|
|
720
|
+
}
|
|
721
|
+
return result;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Exec a tool.
|
|
725
|
+
* Output will be streamed to the live console.
|
|
726
|
+
* Returns promise with return code
|
|
727
|
+
*
|
|
728
|
+
* @param tool path to tool to exec
|
|
729
|
+
* @param options optional exec options. See ExecOptions
|
|
730
|
+
* @returns number
|
|
731
|
+
*/
|
|
732
|
+
exec() {
|
|
733
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
734
|
+
if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) {
|
|
735
|
+
this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
|
|
736
|
+
}
|
|
737
|
+
this.toolPath = yield io.which(this.toolPath, true);
|
|
738
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
739
|
+
this._debug(`exec tool: ${this.toolPath}`);
|
|
740
|
+
this._debug("arguments:");
|
|
741
|
+
for (const arg of this.args) {
|
|
742
|
+
this._debug(` ${arg}`);
|
|
743
|
+
}
|
|
744
|
+
const optionsNonNull = this._cloneExecOptions(this.options);
|
|
745
|
+
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
|
746
|
+
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
|
|
747
|
+
}
|
|
748
|
+
const state = new ExecState(optionsNonNull, this.toolPath);
|
|
749
|
+
state.on("debug", (message) => {
|
|
750
|
+
this._debug(message);
|
|
751
|
+
});
|
|
752
|
+
if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
|
|
753
|
+
return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
|
|
754
|
+
}
|
|
755
|
+
const fileName = this._getSpawnFileName();
|
|
756
|
+
const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
|
|
757
|
+
let stdbuffer = "";
|
|
758
|
+
if (cp.stdout) {
|
|
759
|
+
cp.stdout.on("data", (data) => {
|
|
760
|
+
if (this.options.listeners && this.options.listeners.stdout) {
|
|
761
|
+
this.options.listeners.stdout(data);
|
|
762
|
+
}
|
|
763
|
+
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
|
764
|
+
optionsNonNull.outStream.write(data);
|
|
765
|
+
}
|
|
766
|
+
stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
|
|
767
|
+
if (this.options.listeners && this.options.listeners.stdline) {
|
|
768
|
+
this.options.listeners.stdline(line);
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
let errbuffer = "";
|
|
774
|
+
if (cp.stderr) {
|
|
775
|
+
cp.stderr.on("data", (data) => {
|
|
776
|
+
state.processStderr = true;
|
|
777
|
+
if (this.options.listeners && this.options.listeners.stderr) {
|
|
778
|
+
this.options.listeners.stderr(data);
|
|
779
|
+
}
|
|
780
|
+
if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) {
|
|
781
|
+
const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream;
|
|
782
|
+
s.write(data);
|
|
783
|
+
}
|
|
784
|
+
errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
|
|
785
|
+
if (this.options.listeners && this.options.listeners.errline) {
|
|
786
|
+
this.options.listeners.errline(line);
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
cp.on("error", (err) => {
|
|
792
|
+
state.processError = err.message;
|
|
793
|
+
state.processExited = true;
|
|
794
|
+
state.processClosed = true;
|
|
795
|
+
state.CheckComplete();
|
|
796
|
+
});
|
|
797
|
+
cp.on("exit", (code) => {
|
|
798
|
+
state.processExitCode = code;
|
|
799
|
+
state.processExited = true;
|
|
800
|
+
this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
|
|
801
|
+
state.CheckComplete();
|
|
802
|
+
});
|
|
803
|
+
cp.on("close", (code) => {
|
|
804
|
+
state.processExitCode = code;
|
|
805
|
+
state.processExited = true;
|
|
806
|
+
state.processClosed = true;
|
|
807
|
+
this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
|
|
808
|
+
state.CheckComplete();
|
|
809
|
+
});
|
|
810
|
+
state.on("done", (error, exitCode) => {
|
|
811
|
+
if (stdbuffer.length > 0) {
|
|
812
|
+
this.emit("stdline", stdbuffer);
|
|
813
|
+
}
|
|
814
|
+
if (errbuffer.length > 0) {
|
|
815
|
+
this.emit("errline", errbuffer);
|
|
816
|
+
}
|
|
817
|
+
cp.removeAllListeners();
|
|
818
|
+
if (error) {
|
|
819
|
+
reject(error);
|
|
820
|
+
} else {
|
|
821
|
+
resolve(exitCode);
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
if (this.options.input) {
|
|
825
|
+
if (!cp.stdin) {
|
|
826
|
+
throw new Error("child process missing stdin");
|
|
827
|
+
}
|
|
828
|
+
cp.stdin.end(this.options.input);
|
|
829
|
+
}
|
|
830
|
+
}));
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
exports2.ToolRunner = ToolRunner;
|
|
835
|
+
function argStringToArray(argString) {
|
|
836
|
+
const args = [];
|
|
837
|
+
let inQuotes = false;
|
|
838
|
+
let escaped = false;
|
|
839
|
+
let arg = "";
|
|
840
|
+
function append(c) {
|
|
841
|
+
if (escaped && c !== '"') {
|
|
842
|
+
arg += "\\";
|
|
843
|
+
}
|
|
844
|
+
arg += c;
|
|
845
|
+
escaped = false;
|
|
846
|
+
}
|
|
847
|
+
for (let i = 0; i < argString.length; i++) {
|
|
848
|
+
const c = argString.charAt(i);
|
|
849
|
+
if (c === '"') {
|
|
850
|
+
if (!escaped) {
|
|
851
|
+
inQuotes = !inQuotes;
|
|
852
|
+
} else {
|
|
853
|
+
append(c);
|
|
854
|
+
}
|
|
855
|
+
continue;
|
|
856
|
+
}
|
|
857
|
+
if (c === "\\" && escaped) {
|
|
858
|
+
append(c);
|
|
859
|
+
continue;
|
|
860
|
+
}
|
|
861
|
+
if (c === "\\" && inQuotes) {
|
|
862
|
+
escaped = true;
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
if (c === " " && !inQuotes) {
|
|
866
|
+
if (arg.length > 0) {
|
|
867
|
+
args.push(arg);
|
|
868
|
+
arg = "";
|
|
869
|
+
}
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
append(c);
|
|
873
|
+
}
|
|
874
|
+
if (arg.length > 0) {
|
|
875
|
+
args.push(arg.trim());
|
|
876
|
+
}
|
|
877
|
+
return args;
|
|
878
|
+
}
|
|
879
|
+
exports2.argStringToArray = argStringToArray;
|
|
880
|
+
var ExecState = class _ExecState extends events.EventEmitter {
|
|
881
|
+
constructor(options, toolPath) {
|
|
882
|
+
super();
|
|
883
|
+
this.processClosed = false;
|
|
884
|
+
this.processError = "";
|
|
885
|
+
this.processExitCode = 0;
|
|
886
|
+
this.processExited = false;
|
|
887
|
+
this.processStderr = false;
|
|
888
|
+
this.delay = 1e4;
|
|
889
|
+
this.done = false;
|
|
890
|
+
this.timeout = null;
|
|
891
|
+
if (!toolPath) {
|
|
892
|
+
throw new Error("toolPath must not be empty");
|
|
893
|
+
}
|
|
894
|
+
this.options = options;
|
|
895
|
+
this.toolPath = toolPath;
|
|
896
|
+
if (options.delay) {
|
|
897
|
+
this.delay = options.delay;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
CheckComplete() {
|
|
901
|
+
if (this.done) {
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
if (this.processClosed) {
|
|
905
|
+
this._setResult();
|
|
906
|
+
} else if (this.processExited) {
|
|
907
|
+
this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
_debug(message) {
|
|
911
|
+
this.emit("debug", message);
|
|
912
|
+
}
|
|
913
|
+
_setResult() {
|
|
914
|
+
let error;
|
|
915
|
+
if (this.processExited) {
|
|
916
|
+
if (this.processError) {
|
|
917
|
+
error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
|
|
918
|
+
} else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
|
|
919
|
+
error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
|
|
920
|
+
} else if (this.processStderr && this.options.failOnStdErr) {
|
|
921
|
+
error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
if (this.timeout) {
|
|
925
|
+
clearTimeout(this.timeout);
|
|
926
|
+
this.timeout = null;
|
|
927
|
+
}
|
|
928
|
+
this.done = true;
|
|
929
|
+
this.emit("done", error, this.processExitCode);
|
|
930
|
+
}
|
|
931
|
+
static HandleTimeout(state) {
|
|
932
|
+
if (state.done) {
|
|
933
|
+
return;
|
|
934
|
+
}
|
|
935
|
+
if (!state.processClosed && state.processExited) {
|
|
936
|
+
const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
|
|
937
|
+
state._debug(message);
|
|
938
|
+
}
|
|
939
|
+
state._setResult();
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
|
|
945
|
+
// node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/exec.js
|
|
946
|
+
var require_exec = __commonJS({
|
|
947
|
+
"node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/exec.js"(exports2) {
|
|
948
|
+
"use strict";
|
|
949
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
950
|
+
if (k2 === void 0) k2 = k;
|
|
951
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
952
|
+
return m[k];
|
|
953
|
+
} });
|
|
954
|
+
} : function(o, m, k, k2) {
|
|
955
|
+
if (k2 === void 0) k2 = k;
|
|
956
|
+
o[k2] = m[k];
|
|
957
|
+
});
|
|
958
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
959
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
960
|
+
} : function(o, v) {
|
|
961
|
+
o["default"] = v;
|
|
962
|
+
});
|
|
963
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
964
|
+
if (mod && mod.__esModule) return mod;
|
|
965
|
+
var result = {};
|
|
966
|
+
if (mod != null) {
|
|
967
|
+
for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
968
|
+
}
|
|
969
|
+
__setModuleDefault(result, mod);
|
|
970
|
+
return result;
|
|
971
|
+
};
|
|
972
|
+
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
973
|
+
function adopt(value) {
|
|
974
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
975
|
+
resolve(value);
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
979
|
+
function fulfilled(value) {
|
|
980
|
+
try {
|
|
981
|
+
step(generator.next(value));
|
|
982
|
+
} catch (e) {
|
|
983
|
+
reject(e);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
function rejected(value) {
|
|
987
|
+
try {
|
|
988
|
+
step(generator["throw"](value));
|
|
989
|
+
} catch (e) {
|
|
990
|
+
reject(e);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
function step(result) {
|
|
994
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
995
|
+
}
|
|
996
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
997
|
+
});
|
|
998
|
+
};
|
|
999
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1000
|
+
exports2.getExecOutput = exports2.exec = void 0;
|
|
1001
|
+
var string_decoder_1 = require("string_decoder");
|
|
1002
|
+
var tr = __importStar(require_toolrunner());
|
|
1003
|
+
function exec(commandLine, args, options) {
|
|
1004
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1005
|
+
const commandArgs = tr.argStringToArray(commandLine);
|
|
1006
|
+
if (commandArgs.length === 0) {
|
|
1007
|
+
throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
|
|
1008
|
+
}
|
|
1009
|
+
const toolPath = commandArgs[0];
|
|
1010
|
+
args = commandArgs.slice(1).concat(args || []);
|
|
1011
|
+
const runner = new tr.ToolRunner(toolPath, args, options);
|
|
1012
|
+
return runner.exec();
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
exports2.exec = exec;
|
|
1016
|
+
function getExecOutput2(commandLine, args, options) {
|
|
1017
|
+
var _a, _b;
|
|
1018
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1019
|
+
let stdout = "";
|
|
1020
|
+
let stderr = "";
|
|
1021
|
+
const stdoutDecoder = new string_decoder_1.StringDecoder("utf8");
|
|
1022
|
+
const stderrDecoder = new string_decoder_1.StringDecoder("utf8");
|
|
1023
|
+
const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
|
|
1024
|
+
const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
|
|
1025
|
+
const stdErrListener = (data) => {
|
|
1026
|
+
stderr += stderrDecoder.write(data);
|
|
1027
|
+
if (originalStdErrListener) {
|
|
1028
|
+
originalStdErrListener(data);
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
const stdOutListener = (data) => {
|
|
1032
|
+
stdout += stdoutDecoder.write(data);
|
|
1033
|
+
if (originalStdoutListener) {
|
|
1034
|
+
originalStdoutListener(data);
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
|
|
1038
|
+
const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
|
|
1039
|
+
stdout += stdoutDecoder.end();
|
|
1040
|
+
stderr += stderrDecoder.end();
|
|
1041
|
+
return {
|
|
1042
|
+
exitCode,
|
|
1043
|
+
stdout,
|
|
1044
|
+
stderr
|
|
1045
|
+
};
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
exports2.getExecOutput = getExecOutput2;
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
|
|
1052
|
+
// packages/k8s-tools/src/executors/helm-package/executor.ts
|
|
1053
|
+
var executor_exports = {};
|
|
1054
|
+
__export(executor_exports, {
|
|
1055
|
+
default: () => executor_default,
|
|
1056
|
+
serveExecutor: () => serveExecutor
|
|
1057
|
+
});
|
|
1058
|
+
module.exports = __toCommonJS(executor_exports);
|
|
1059
|
+
var import_workspace_tools = require("@storm-software/workspace-tools");
|
|
1060
|
+
|
|
1061
|
+
// packages/k8s-tools/src/utils/client.ts
|
|
1062
|
+
var import_exec = __toESM(require_exec());
|
|
1063
|
+
|
|
1064
|
+
// packages/k8s-tools/src/types.ts
|
|
1065
|
+
var AbstractHelmClient = class {
|
|
1066
|
+
initialized = false;
|
|
1067
|
+
async initialize() {
|
|
1068
|
+
throw new Error("Method not implemented.");
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
// packages/k8s-tools/src/utils/ensure-init.ts
|
|
1073
|
+
var ensureInitialized = (target, propertyKey, descriptor) => {
|
|
1074
|
+
const originalMethod = descriptor.value;
|
|
1075
|
+
descriptor.value = async function(...arguments_) {
|
|
1076
|
+
const self = this;
|
|
1077
|
+
if (self.initialized === void 0 || typeof self.initialize !== "function") {
|
|
1078
|
+
throw new TypeError(
|
|
1079
|
+
`The ensureInitialized decorator can only be applied in classes with an 'initialized' property and 'initialize' method.`
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1082
|
+
if (!self.initialized) {
|
|
1083
|
+
await self.initialize();
|
|
1084
|
+
}
|
|
1085
|
+
return originalMethod.apply(this, arguments_);
|
|
1086
|
+
};
|
|
1087
|
+
return descriptor;
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
// packages/k8s-tools/src/utils/client.ts
|
|
1091
|
+
var HelmClient = class extends AbstractHelmClient {
|
|
1092
|
+
async package(options) {
|
|
1093
|
+
let chartPath = void 0;
|
|
1094
|
+
await (0, import_exec.getExecOutput)("helm", [
|
|
1095
|
+
"package",
|
|
1096
|
+
options.chartFolder,
|
|
1097
|
+
"-d",
|
|
1098
|
+
options.outputFolder
|
|
1099
|
+
]).then((output) => {
|
|
1100
|
+
if (output.stderr.length > 0 && output.exitCode !== 0) {
|
|
1101
|
+
throw new Error(`Failed to package chart: ${output.stderr}`);
|
|
1102
|
+
}
|
|
1103
|
+
const stdout = output.stdout;
|
|
1104
|
+
const match = stdout.match(
|
|
1105
|
+
/Successfully packaged chart and saved it to: (.+)/
|
|
1106
|
+
);
|
|
1107
|
+
if (!match) {
|
|
1108
|
+
throw new Error("Failed to parse chart path from helm output");
|
|
1109
|
+
}
|
|
1110
|
+
chartPath = match[1]?.trim();
|
|
1111
|
+
});
|
|
1112
|
+
return chartPath;
|
|
1113
|
+
}
|
|
1114
|
+
async push(options) {
|
|
1115
|
+
await (0, import_exec.getExecOutput)("helm", [
|
|
1116
|
+
"push",
|
|
1117
|
+
options.chartPath,
|
|
1118
|
+
options.remote
|
|
1119
|
+
]).then((output) => {
|
|
1120
|
+
if (output.stderr.length > 0 && output.exitCode !== 0) {
|
|
1121
|
+
throw new Error(`Failed to push chart: ${output.stderr}`);
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
async dependencyUpdate(chartFolder) {
|
|
1126
|
+
await (0, import_exec.getExecOutput)("helm", ["dependency", "update", chartFolder]).then(
|
|
1127
|
+
(output) => {
|
|
1128
|
+
if (output.stderr.length > 0 && output.exitCode !== 0) {
|
|
1129
|
+
throw new Error(
|
|
1130
|
+
`Failed to update chart dependencies: ${output.stderr}`
|
|
1131
|
+
);
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
async dependencyBuild(chartFolder) {
|
|
1137
|
+
await (0, import_exec.getExecOutput)("helm", ["dependency", "build", chartFolder]).then(
|
|
1138
|
+
(output) => {
|
|
1139
|
+
if (output.stderr.length > 0 && output.exitCode !== 0) {
|
|
1140
|
+
throw new Error(
|
|
1141
|
+
`Failed to build chart dependencies: ${output.stderr}`
|
|
1142
|
+
);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
async addRepository(name, url) {
|
|
1148
|
+
await (0, import_exec.getExecOutput)("helm", ["repo", "add", name, url]).then((output) => {
|
|
1149
|
+
if (output.stderr.length > 0 && output.exitCode !== 0) {
|
|
1150
|
+
throw new Error(`Failed to add repository: ${output.stderr}`);
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Initialize Helm
|
|
1156
|
+
*
|
|
1157
|
+
* @returns {Promise<void>}
|
|
1158
|
+
*/
|
|
1159
|
+
async initialize() {
|
|
1160
|
+
if (this.initialized) {
|
|
1161
|
+
return;
|
|
1162
|
+
}
|
|
1163
|
+
await (0, import_exec.getExecOutput)("helm", ["version"]).then((output) => {
|
|
1164
|
+
if (output.stderr.length > 0 && output.exitCode !== 0) {
|
|
1165
|
+
throw new Error(`Helm is not installed: ${output.stderr}`);
|
|
1166
|
+
}
|
|
1167
|
+
this.initialized = true;
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
};
|
|
1171
|
+
__decorateClass([
|
|
1172
|
+
ensureInitialized
|
|
1173
|
+
], HelmClient.prototype, "package", 1);
|
|
1174
|
+
__decorateClass([
|
|
1175
|
+
ensureInitialized
|
|
1176
|
+
], HelmClient.prototype, "push", 1);
|
|
1177
|
+
__decorateClass([
|
|
1178
|
+
ensureInitialized
|
|
1179
|
+
], HelmClient.prototype, "dependencyUpdate", 1);
|
|
1180
|
+
__decorateClass([
|
|
1181
|
+
ensureInitialized
|
|
1182
|
+
], HelmClient.prototype, "dependencyBuild", 1);
|
|
1183
|
+
__decorateClass([
|
|
1184
|
+
ensureInitialized
|
|
1185
|
+
], HelmClient.prototype, "addRepository", 1);
|
|
1186
|
+
var createHelmClient = () => {
|
|
1187
|
+
return new HelmClient();
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
// packages/k8s-tools/src/executors/helm-package/executor.ts
|
|
1191
|
+
async function serveExecutor(options, context, config) {
|
|
1192
|
+
const { writeWarning } = await import("@storm-software/config-tools");
|
|
1193
|
+
if (!context?.projectName || !context?.projectsConfigurations?.projects?.[context.projectName]?.root) {
|
|
1194
|
+
throw new Error("Nx executor context was invalid");
|
|
1195
|
+
}
|
|
1196
|
+
const helm = createHelmClient();
|
|
1197
|
+
if (options.dependencies?.repositories) {
|
|
1198
|
+
for (const repository of options.dependencies.repositories) {
|
|
1199
|
+
if (repository.name && repository.url) {
|
|
1200
|
+
await helm.addRepository(repository.name, repository.url);
|
|
1201
|
+
} else {
|
|
1202
|
+
throw new Error("Repository name and url are required");
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
if (options.dependencies?.update) {
|
|
1207
|
+
await helm.dependencyUpdate(options.chartFolder);
|
|
1208
|
+
}
|
|
1209
|
+
if (options.dependencies?.build) {
|
|
1210
|
+
await helm.dependencyBuild(options.chartFolder);
|
|
1211
|
+
}
|
|
1212
|
+
const chartPath = await helm.package({
|
|
1213
|
+
chartFolder: options.chartFolder,
|
|
1214
|
+
outputFolder: options.outputFolder
|
|
1215
|
+
});
|
|
1216
|
+
if (options.push && chartPath && options.remote) {
|
|
1217
|
+
await helm.push({
|
|
1218
|
+
chartPath,
|
|
1219
|
+
remote: options.remote
|
|
1220
|
+
});
|
|
1221
|
+
} else {
|
|
1222
|
+
writeWarning(`Chart packaged at: ${chartPath}`, config);
|
|
1223
|
+
}
|
|
1224
|
+
return {
|
|
1225
|
+
success: true
|
|
1226
|
+
};
|
|
1227
|
+
}
|
|
1228
|
+
var executor_default = (0, import_workspace_tools.withRunExecutor)(
|
|
1229
|
+
"Helm Chart Package executor",
|
|
1230
|
+
serveExecutor,
|
|
1231
|
+
{
|
|
1232
|
+
skipReadingConfig: false,
|
|
1233
|
+
hooks: {
|
|
1234
|
+
applyDefaultOptions: (options) => {
|
|
1235
|
+
options.port ??= 4500;
|
|
1236
|
+
return options;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
);
|
|
1241
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1242
|
+
0 && (module.exports = {
|
|
1243
|
+
serveExecutor
|
|
1244
|
+
});
|