@storm-software/k8s-tools 0.18.0 → 0.19.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/CHANGELOG.md +17 -0
- package/dist/chunk-2GAU2GHG.js +203 -0
- package/dist/chunk-2QNNUD5M.js +86 -0
- package/dist/chunk-3GQAWCBQ.js +13 -0
- package/dist/chunk-3J7KBHMJ.mjs +0 -0
- package/dist/chunk-6V45YKVB.mjs +203 -0
- package/dist/chunk-7AV2CVBT.mjs +169 -0
- package/dist/chunk-7BCSLKT3.js +98 -0
- package/dist/chunk-7IJP4RLN.mjs +63 -0
- package/dist/chunk-AFPEYAYK.js +61 -0
- package/dist/chunk-DHBG5ASJ.js +1 -0
- package/dist/chunk-DZ5UCMNL.mjs +1063 -0
- package/dist/chunk-EAQFLLRB.js +23 -0
- package/dist/chunk-EISL3C34.js +169 -0
- package/dist/chunk-GDXB64KG.js +1063 -0
- package/dist/chunk-GOVHOOTS.js +184 -0
- package/dist/chunk-IOT45LXV.js +134 -0
- package/dist/chunk-LFNGKV6F.js +18 -0
- package/dist/chunk-LSBSNYPQ.mjs +86 -0
- package/dist/chunk-O7U3AH6A.mjs +58 -0
- package/dist/chunk-OA63SGD6.mjs +23 -0
- package/dist/chunk-OBT35QXS.mjs +59 -0
- package/dist/chunk-OXY6AHKS.js +57 -0
- package/dist/chunk-Q6DDBFXE.mjs +147 -0
- package/dist/chunk-RVFKH45R.mjs +134 -0
- package/dist/chunk-T5WNZJOD.js +63 -0
- package/dist/chunk-TUDMFJIT.mjs +98 -0
- package/dist/chunk-U76ID4TS.js +1 -0
- package/dist/chunk-UDLI3L7V.mjs +18 -0
- package/dist/chunk-UWJTAL4W.js +59 -0
- package/dist/chunk-W7DPLC4K.mjs +184 -0
- package/dist/chunk-WWU25UQ4.mjs +0 -0
- package/dist/chunk-XMPMWMWQ.js +147 -0
- package/dist/chunk-XO66D74Z.js +1 -0
- package/dist/chunk-XUV4U54K.mjs +21 -0
- package/dist/chunk-YSCEY447.mjs +0 -0
- package/dist/chunk-ZO7MGNKJ.mjs +61 -0
- package/dist/executor-DY-z8MOl.d.mts +53 -0
- package/dist/executor-Dr6UXfvX.d.ts +53 -0
- package/dist/executors.d.mts +6 -0
- package/dist/executors.d.ts +6 -0
- package/dist/executors.js +19 -0
- package/dist/executors.mjs +19 -0
- package/dist/generator-B5bCfIUV.d.ts +24 -0
- package/dist/generator-BIe65kKR.d.mts +28 -0
- package/dist/generator-Cad7bXVB.d.mts +24 -0
- package/dist/generator-D7M45zOU.d.ts +28 -0
- package/dist/generators.d.mts +6 -0
- package/dist/generators.d.ts +6 -0
- package/dist/generators.js +15 -0
- package/dist/generators.mjs +15 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +57 -0
- package/dist/index.mjs +57 -0
- package/dist/schema.d-Cx_3iG9A.d.mts +150 -0
- package/dist/schema.d-Cx_3iG9A.d.ts +150 -0
- package/dist/src/executors/container-publish/executor.d.mts +11 -0
- package/dist/src/executors/container-publish/executor.d.ts +11 -0
- package/dist/src/executors/container-publish/executor.js +13 -0
- package/dist/src/executors/container-publish/executor.mjs +13 -0
- package/dist/src/executors/helm-package/executor.d.mts +4 -0
- package/dist/src/executors/helm-package/executor.d.ts +4 -0
- package/dist/src/executors/helm-package/executor.js +15 -0
- package/dist/src/executors/helm-package/executor.mjs +15 -0
- package/dist/src/executors/helm-package/schema.d.ts +1 -1
- package/dist/src/generators/helm-chart/files/chart/templates/NOTES.txt +22 -0
- package/dist/src/generators/helm-chart/files/chart/templates/_helpers.yaml +62 -0
- package/dist/src/generators/helm-chart/files/chart/templates/deployment.yaml +68 -0
- package/dist/src/generators/helm-chart/files/chart/templates/hpa.yaml +32 -0
- package/dist/src/generators/helm-chart/files/chart/templates/ingress.yaml +61 -0
- package/dist/src/generators/helm-chart/files/chart/templates/service.yaml +13 -0
- package/dist/src/generators/helm-chart/files/chart/templates/serviceaccount.yaml +13 -0
- package/dist/src/generators/helm-chart/files/chart/templates/test/test-connection.yaml +15 -0
- package/dist/src/generators/helm-chart/generator.d.mts +5 -0
- package/dist/src/generators/helm-chart/generator.d.ts +5 -0
- package/dist/src/generators/helm-chart/generator.js +12 -0
- package/dist/src/generators/helm-chart/generator.mjs +12 -0
- package/dist/src/generators/helm-chart/schema.d.ts +1 -1
- package/dist/src/generators/helm-dependency/generator.d.mts +5 -0
- package/dist/src/generators/helm-dependency/generator.d.ts +5 -0
- package/dist/src/generators/helm-dependency/generator.js +12 -0
- package/dist/src/generators/helm-dependency/generator.mjs +12 -0
- package/dist/src/generators/helm-dependency/schema.d.ts +1 -1
- package/dist/src/plugins/docker/index.d.mts +12 -0
- package/dist/src/plugins/docker/index.d.ts +12 -0
- package/dist/src/plugins/docker/index.js +15 -0
- package/dist/src/plugins/docker/index.mjs +15 -0
- package/dist/src/utils/client.d.mts +35 -0
- package/dist/src/utils/client.d.ts +35 -0
- package/dist/src/utils/client.js +11 -0
- package/dist/src/utils/client.mjs +11 -0
- package/dist/src/utils/ensure-init.d.mts +11 -0
- package/dist/src/utils/ensure-init.d.ts +11 -0
- package/dist/src/utils/ensure-init.js +7 -0
- package/dist/src/utils/ensure-init.mjs +7 -0
- package/dist/src/utils/index.d.mts +6 -0
- package/dist/src/utils/index.d.ts +6 -0
- package/dist/src/utils/index.js +21 -0
- package/dist/src/utils/index.mjs +21 -0
- package/dist/src/utils/prettier.d.mts +13 -0
- package/dist/src/utils/prettier.d.ts +13 -0
- package/dist/src/utils/prettier.js +9 -0
- package/dist/src/utils/prettier.mjs +9 -0
- package/dist/tsup.config.d.mts +5 -0
- package/dist/tsup.config.d.ts +5 -0
- package/dist/tsup.config.js +36 -0
- package/dist/tsup.config.mjs +36 -0
- package/dist/types-BCBFBwnJ.d.mts +20 -0
- package/dist/types-BCBFBwnJ.d.ts +20 -0
- package/dist/types-CIJRaFHD.d.mts +1185 -0
- package/dist/types-CIJRaFHD.d.ts +1185 -0
- package/package.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProjectTagConstants,
|
|
3
|
+
getPackageInfo,
|
|
4
|
+
hasProjectTag,
|
|
5
|
+
isEqualProjectTag,
|
|
6
|
+
setDefaultProjectTags
|
|
7
|
+
} from "./chunk-RVFKH45R.mjs";
|
|
8
|
+
import {
|
|
9
|
+
findWorkspaceRoot,
|
|
10
|
+
loadStormConfig
|
|
11
|
+
} from "./chunk-DZ5UCMNL.mjs";
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "./chunk-XUV4U54K.mjs";
|
|
15
|
+
|
|
16
|
+
// src/plugins/docker/_dockerfile.ts
|
|
17
|
+
import { joinPathFragments, readJsonFile } from "@nx/devkit";
|
|
18
|
+
import { existsSync } from "node:fs";
|
|
19
|
+
var name = "storm-software/docker";
|
|
20
|
+
var description = "Plugin for parsing Dockerfile files";
|
|
21
|
+
var createNodes = [
|
|
22
|
+
"*/**/{Dockerfile,Dockerfile.*}",
|
|
23
|
+
async (dockerFilePath, opts = {
|
|
24
|
+
defaultEngine: "docker"
|
|
25
|
+
}, _) => {
|
|
26
|
+
if (!dockerFilePath) {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
const root = dockerFilePath.substring(dockerFilePath.lastIndexOf("/") + 1);
|
|
30
|
+
const projectJsonPath = joinPathFragments(root, "project.json");
|
|
31
|
+
if (!existsSync(projectJsonPath)) {
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
const projectJson = readJsonFile(projectJsonPath);
|
|
35
|
+
if (projectJson?.name) {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
39
|
+
const config = await loadStormConfig(workspaceRoot);
|
|
40
|
+
Object.keys(projectJson).forEach((key) => {
|
|
41
|
+
if (!project[key]) {
|
|
42
|
+
project[key] = projectJson[key];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const project = {
|
|
46
|
+
root,
|
|
47
|
+
name: projectJson?.name
|
|
48
|
+
};
|
|
49
|
+
const engine = opts.defaultEngine ?? "docker";
|
|
50
|
+
const labels = [
|
|
51
|
+
`org.opencontainers.image.ref.name=${project.name}`,
|
|
52
|
+
`org.opencontainers.image.title=${titleCase(project.name)}`,
|
|
53
|
+
`org.opencontainers.image.authors=${config.organization ? titleCase(config.organization) : "Storm Software"}`,
|
|
54
|
+
`org.opencontainers.image.vendor=${config.organization ? titleCase(config.organization) : "Storm Software"}`,
|
|
55
|
+
`org.opencontainers.image.documentation=${config.docs}`,
|
|
56
|
+
`org.opencontainers.image.url=${config.homepage}`,
|
|
57
|
+
`org.opencontainers.image.source=${config.repository}`
|
|
58
|
+
];
|
|
59
|
+
let tag = "latest";
|
|
60
|
+
const packageManager = getPackageInfo(project);
|
|
61
|
+
if (packageManager) {
|
|
62
|
+
if (packageManager.type === "Cargo.toml") {
|
|
63
|
+
tag = packageManager.content.package.version;
|
|
64
|
+
labels.push(`org.opencontainers.image.description=${packageManager.content.package.description}`);
|
|
65
|
+
} else if (packageManager.type === "package.json") {
|
|
66
|
+
tag = packageManager.content.version;
|
|
67
|
+
labels.push(`org.opencontainers.image.description=${packageManager.content.description}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
project.targets = {
|
|
71
|
+
...project.targets,
|
|
72
|
+
container: {
|
|
73
|
+
executor: "@nx-tools/nx-container:build",
|
|
74
|
+
options: {
|
|
75
|
+
file: dockerFilePath,
|
|
76
|
+
engine,
|
|
77
|
+
labels,
|
|
78
|
+
push: true,
|
|
79
|
+
platforms: [
|
|
80
|
+
"linux/amd64"
|
|
81
|
+
],
|
|
82
|
+
metadata: {
|
|
83
|
+
images: [
|
|
84
|
+
`${config.namespace ? config.namespace : "storm-software"}/${project.name?.replace(`${config.namespace}-`, "")}`,
|
|
85
|
+
`ghcr.io/${config.organization ? config.organization : "storm-software"}/${project.name}`
|
|
86
|
+
],
|
|
87
|
+
tags: [
|
|
88
|
+
"type=schedule",
|
|
89
|
+
"type=ref,event=branch",
|
|
90
|
+
"type=ref,event=tag",
|
|
91
|
+
"type=ref,event=pr",
|
|
92
|
+
"type=semver,pattern={{version}}",
|
|
93
|
+
"type=semver,pattern={{major}}.{{minor}}",
|
|
94
|
+
"type=semver,pattern={{major}}",
|
|
95
|
+
"type=sha"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
defaultConfiguration: "production",
|
|
100
|
+
configurations: {
|
|
101
|
+
development: {
|
|
102
|
+
quiet: false,
|
|
103
|
+
"build-args": [
|
|
104
|
+
"ENVIRONMENT=development",
|
|
105
|
+
"DEBUG_IMAGE=true",
|
|
106
|
+
`RELEASE=${tag}`
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
production: {
|
|
110
|
+
quiet: true,
|
|
111
|
+
"build-args": [
|
|
112
|
+
"ENVIRONMENT=production",
|
|
113
|
+
"DEBUG_IMAGE=false",
|
|
114
|
+
`RELEASE=${tag}`
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
if ((isEqualProjectTag(project, ProjectTagConstants.ProjectType.TAG_ID, ProjectTagConstants.ProjectType.APPLICATION) || project.projectType === "application") && hasProjectTag(project, ProjectTagConstants.Registry.TAG_ID)) {
|
|
121
|
+
if (project.targets["nx-release-publish"]) {
|
|
122
|
+
project.targets["nx-release-publish"] = {
|
|
123
|
+
...project.targets["nx-release-publish"],
|
|
124
|
+
executor: "@storm-software/k8s-tools:container-publish",
|
|
125
|
+
options: {
|
|
126
|
+
packageRoot: project.root
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
} else {
|
|
130
|
+
project.targets["nx-release-publish"] = {
|
|
131
|
+
cache: true,
|
|
132
|
+
inputs: [
|
|
133
|
+
"linting",
|
|
134
|
+
"testing",
|
|
135
|
+
"documentation",
|
|
136
|
+
"rust",
|
|
137
|
+
"^production"
|
|
138
|
+
],
|
|
139
|
+
dependsOn: [
|
|
140
|
+
"build",
|
|
141
|
+
"^nx-release-publish"
|
|
142
|
+
],
|
|
143
|
+
executor: "@storm-software/k8s-tools:container-publish",
|
|
144
|
+
options: {
|
|
145
|
+
packageRoot: project.root
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
setDefaultProjectTags(project);
|
|
151
|
+
const projects = {};
|
|
152
|
+
const externalNodes = {};
|
|
153
|
+
projects[project.root] = {
|
|
154
|
+
...project,
|
|
155
|
+
release: {
|
|
156
|
+
...project.release,
|
|
157
|
+
version: {
|
|
158
|
+
...project.release?.version,
|
|
159
|
+
generator: "@storm-software/workspace-tools:release-version"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
return {
|
|
164
|
+
projects,
|
|
165
|
+
externalNodes
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
];
|
|
169
|
+
var createDependencies = /* @__PURE__ */ __name((_, context) => {
|
|
170
|
+
return [];
|
|
171
|
+
}, "createDependencies");
|
|
172
|
+
var titleCase = /* @__PURE__ */ __name((input) => {
|
|
173
|
+
if (!input) {
|
|
174
|
+
return "";
|
|
175
|
+
}
|
|
176
|
+
return input.split(/(?=[A-Z])|[\.\-\s_]/).map((s) => s.trim()).filter((s) => !!s).map((s) => s ? s.toLowerCase().charAt(0).toUpperCase() + s.toLowerCase().slice(1) : s).join(" ");
|
|
177
|
+
}, "titleCase");
|
|
178
|
+
|
|
179
|
+
export {
|
|
180
|
+
name,
|
|
181
|
+
description,
|
|
182
|
+
createNodes,
|
|
183
|
+
createDependencies
|
|
184
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
|
+
|
|
3
|
+
var _chunkUWJTAL4Wjs = require('./chunk-UWJTAL4W.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkIOT45LXVjs = require('./chunk-IOT45LXV.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkAFPEYAYKjs = require('./chunk-AFPEYAYK.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkGDXB64KGjs = require('./chunk-GDXB64KG.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
17
|
+
|
|
18
|
+
// src/executors/container-publish/executor.ts
|
|
19
|
+
var _devkit = require('@nx/devkit');
|
|
20
|
+
var _https = require('https'); var _https2 = _interopRequireDefault(_https);
|
|
21
|
+
async function* publishExecutor(options, context) {
|
|
22
|
+
const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
|
|
23
|
+
if (!context.projectName) {
|
|
24
|
+
throw new Error("The executor requires a projectName.");
|
|
25
|
+
}
|
|
26
|
+
console.info(`\u{1F680} Running Storm Container Registry Publish executor on the ${context.projectName} crate`);
|
|
27
|
+
const workspaceRoot = _chunkGDXB64KGjs.findWorkspaceRoot.call(void 0, );
|
|
28
|
+
const config = await _chunkGDXB64KGjs.loadStormConfig.call(void 0, workspaceRoot);
|
|
29
|
+
const projectConfig = _optionalChain([context, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects, 'access', _3 => _3[context.projectName]]);
|
|
30
|
+
if (!projectConfig) {
|
|
31
|
+
throw new Error(`The executor requires a valid projectsConfiguration - No configuration found for project ${context.projectName}`);
|
|
32
|
+
}
|
|
33
|
+
const projectRoot = _nullishCoalesce(_optionalChain([projectConfig, 'optionalAccess', _4 => _4.root]), () => ( workspaceRoot));
|
|
34
|
+
const sourceRoot = _nullishCoalesce(_optionalChain([projectConfig, 'optionalAccess', _5 => _5.sourceRoot]), () => ( workspaceRoot));
|
|
35
|
+
const projectName = _nullishCoalesce(_optionalChain([projectConfig, 'optionalAccess', _6 => _6.name]), () => ( context.projectName));
|
|
36
|
+
config.workspaceRoot = workspaceRoot;
|
|
37
|
+
const tokenized = await _chunkAFPEYAYKjs.applyWorkspaceTokens.call(void 0, options, {
|
|
38
|
+
config,
|
|
39
|
+
workspaceRoot,
|
|
40
|
+
projectRoot,
|
|
41
|
+
sourceRoot,
|
|
42
|
+
projectName,
|
|
43
|
+
...projectConfig
|
|
44
|
+
}, _chunkUWJTAL4Wjs.applyWorkspaceExecutorTokens);
|
|
45
|
+
tokenized.engine ??= "docker";
|
|
46
|
+
tokenized.registry ??= config.registry.container;
|
|
47
|
+
try {
|
|
48
|
+
if (isDryRun) {
|
|
49
|
+
console.log(`Would publish to ${tokenized.registry}, but [dry-run] was set`);
|
|
50
|
+
} else {
|
|
51
|
+
console.log(`Published to ${tokenized.registry}`);
|
|
52
|
+
const packageManager = _chunkIOT45LXVjs.getPackageInfo.call(void 0, projectConfig);
|
|
53
|
+
if (packageManager) {
|
|
54
|
+
tokenized["build-args"] ??= [
|
|
55
|
+
"ENVIRONMENT=production",
|
|
56
|
+
"DEBUG_IMAGE=false"
|
|
57
|
+
];
|
|
58
|
+
tokenized["labels"] ??= [];
|
|
59
|
+
let version = "";
|
|
60
|
+
if (process.env.TAG) {
|
|
61
|
+
version = process.env.TAG;
|
|
62
|
+
} else {
|
|
63
|
+
if (packageManager.type === "Cargo.toml") {
|
|
64
|
+
version = packageManager.content.package.version;
|
|
65
|
+
} else if (packageManager.type === "package.json") {
|
|
66
|
+
version = packageManager.content.version;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
tokenized["build-args"].push(`RELEASE=${version}`);
|
|
70
|
+
tokenized["labels"].push(`org.opencontainers.image.version=${version}`);
|
|
71
|
+
const tags = await getRegistryVersion(projectName, config);
|
|
72
|
+
if (tags.length === 0) {
|
|
73
|
+
tokenized["labels"].push(`org.opencontainers.image.created=${(/* @__PURE__ */ new Date()).toISOString()}`);
|
|
74
|
+
} else if (tags.includes(version)) {
|
|
75
|
+
console.warn(`Skipped package "${projectName}" because v${version} already exists in ${tokenized.registry}`);
|
|
76
|
+
return {
|
|
77
|
+
success: true
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
console.warn(`No package manager found for project "${projectName}" - Skipping container publishing`);
|
|
82
|
+
return {
|
|
83
|
+
success: true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const { project, target, configuration } = _devkit.parseTargetString.call(void 0, "container", context);
|
|
87
|
+
for await (const output of await _devkit.runExecutor.call(void 0, {
|
|
88
|
+
project,
|
|
89
|
+
target,
|
|
90
|
+
configuration
|
|
91
|
+
}, tokenized, context)) {
|
|
92
|
+
if (!output.success) {
|
|
93
|
+
throw new Error("Could not compile application files");
|
|
94
|
+
}
|
|
95
|
+
yield;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
success: true
|
|
100
|
+
};
|
|
101
|
+
} catch (error) {
|
|
102
|
+
console.error(`Failed to publish to ${tokenized.registry}`);
|
|
103
|
+
console.error(error);
|
|
104
|
+
console.log("");
|
|
105
|
+
return {
|
|
106
|
+
success: false
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
_chunk3GQAWCBQjs.__name.call(void 0, publishExecutor, "publishExecutor");
|
|
111
|
+
var getRegistryVersion = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, config) => {
|
|
112
|
+
if (!name) {
|
|
113
|
+
throw new Error("The `getRegistryVersion` function requires a container name.");
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const tagsApiUrl = `${config.registry.container}/v2/namespaces/${encodeURIComponent(config.namespace ? config.namespace : "storm-software")}/repositories/${encodeURIComponent(name.replace(`${config.namespace}-`, ""))}/tags`;
|
|
117
|
+
console.log(`Checking for existing version at ${tagsApiUrl}`);
|
|
118
|
+
return new Promise((resolve, reject) => _https2.default.get(tagsApiUrl, (res) => {
|
|
119
|
+
if (res.statusCode === 404) {
|
|
120
|
+
console.log(`No existing version found at ${tagsApiUrl}`);
|
|
121
|
+
return resolve([]);
|
|
122
|
+
}
|
|
123
|
+
res.on("data", (data) => {
|
|
124
|
+
if (data) {
|
|
125
|
+
console.log(`Existing versions found at ${tagsApiUrl} - ${data}`);
|
|
126
|
+
const json = JSON.parse(data.toString());
|
|
127
|
+
return resolve(json.results.filter((result) => result.status === "active" && result.name && result.name !== "latest").map((result) => result.name));
|
|
128
|
+
}
|
|
129
|
+
return reject(new Error("No data returned from container registry, expected a 404 if no tags exist"));
|
|
130
|
+
});
|
|
131
|
+
}).on("error", (e) => {
|
|
132
|
+
throw e;
|
|
133
|
+
}));
|
|
134
|
+
} catch (error) {
|
|
135
|
+
console.error(`Failed to get version from ${config.registry.container}`);
|
|
136
|
+
console.error(error);
|
|
137
|
+
console.log("");
|
|
138
|
+
throw new Error(`Could not get version from container registry - ${config.registry.container}`, {
|
|
139
|
+
cause: error
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}, "getRegistryVersion");
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
exports.publishExecutor = publishExecutor; exports.getRegistryVersion = getRegistryVersion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// ../../node_modules/.pnpm/tsup@8.3.5_@microsoft+api-extractor@7.49.1_@types+node@22.10.7__@swc+core@1.7.26_@swc+helpers_ekim6y52mwpq6ssxiprcp44dam/node_modules/tsup/assets/esm_shims.js
|
|
11
|
+
import { fileURLToPath } from "url";
|
|
12
|
+
import path from "path";
|
|
13
|
+
var getFilename = /* @__PURE__ */ __name(() => fileURLToPath(import.meta.url), "getFilename");
|
|
14
|
+
var getDirname = /* @__PURE__ */ __name(() => path.dirname(getFilename()), "getDirname");
|
|
15
|
+
var __dirname = /* @__PURE__ */ getDirname();
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
__name,
|
|
19
|
+
__require,
|
|
20
|
+
__dirname
|
|
21
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findWorkspaceRoot
|
|
3
|
+
} from "./chunk-DZ5UCMNL.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__name
|
|
6
|
+
} from "./chunk-XUV4U54K.mjs";
|
|
7
|
+
|
|
8
|
+
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
9
|
+
var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenizerOptions) => {
|
|
10
|
+
let result = option;
|
|
11
|
+
if (!result) {
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
if (tokenizerOptions) {
|
|
15
|
+
const optionKeys = Object.keys(tokenizerOptions);
|
|
16
|
+
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
17
|
+
for (const optionKey of optionKeys) {
|
|
18
|
+
if (result.includes(`{${optionKey}}`)) {
|
|
19
|
+
result = result.replaceAll(`{${optionKey}}`, tokenizerOptions.config?.[optionKey] ?? "");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (tokenizerOptions.config) {
|
|
25
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
26
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
27
|
+
for (const configKey of configKeys) {
|
|
28
|
+
if (result.includes(`{${configKey}}`)) {
|
|
29
|
+
result = result.replaceAll(`{${configKey}}`, tokenizerOptions.config[configKey]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (result.includes("{workspaceRoot}")) {
|
|
35
|
+
result = result.replaceAll("{workspaceRoot}", tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot());
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}, "applyWorkspaceBaseTokens");
|
|
39
|
+
var applyWorkspaceTokens = /* @__PURE__ */ __name(async (options, config, tokenizerFn) => {
|
|
40
|
+
if (!options) {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
const result = {};
|
|
44
|
+
for (const option of Object.keys(options)) {
|
|
45
|
+
if (typeof options[option] === "string") {
|
|
46
|
+
result[option] = await Promise.resolve(tokenizerFn(options[option], config));
|
|
47
|
+
} else if (Array.isArray(options[option])) {
|
|
48
|
+
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item));
|
|
49
|
+
} else if (typeof options[option] === "object") {
|
|
50
|
+
result[option] = await applyWorkspaceTokens(options[option], config, tokenizerFn);
|
|
51
|
+
} else {
|
|
52
|
+
result[option] = options[option];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}, "applyWorkspaceTokens");
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
applyWorkspaceBaseTokens,
|
|
60
|
+
applyWorkspaceTokens
|
|
61
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ExecutorContext, PromiseExecutor } from '@nx/devkit';
|
|
2
|
+
import { S as StormConfig } from './types-CIJRaFHD.mjs';
|
|
3
|
+
|
|
4
|
+
// Generated by @storm-software/untyped
|
|
5
|
+
// Do not edit this file directly
|
|
6
|
+
|
|
7
|
+
interface BaseExecutorSchema {
|
|
8
|
+
/**
|
|
9
|
+
* Output Path
|
|
10
|
+
*
|
|
11
|
+
* The output path for the build
|
|
12
|
+
*
|
|
13
|
+
* @default "dist/{projectRoot}"
|
|
14
|
+
*
|
|
15
|
+
* @format path
|
|
16
|
+
*/
|
|
17
|
+
outputPath?: string,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface HelmPackageExecutorSchema extends BaseExecutorSchema {
|
|
21
|
+
/** Folder where the chart is stored */
|
|
22
|
+
chartFolder: string;
|
|
23
|
+
/** Folder to store the packaged chart */
|
|
24
|
+
outputFolder: string;
|
|
25
|
+
/** Push the chart to a remote registry */
|
|
26
|
+
push?: boolean;
|
|
27
|
+
/** Remote registry to publish the chart */
|
|
28
|
+
remote?: string;
|
|
29
|
+
/** Options related to dependencies */
|
|
30
|
+
dependencies?: {
|
|
31
|
+
/** Runs `helm dependency update` before packaging */
|
|
32
|
+
update?: boolean;
|
|
33
|
+
/** Runs `helm dependency build` before packaging */
|
|
34
|
+
build?: boolean;
|
|
35
|
+
/** List of repositories to add with `helm repo add` before packaging */
|
|
36
|
+
repositories?: {
|
|
37
|
+
/** Name of the repository */
|
|
38
|
+
name?: string;
|
|
39
|
+
/** URL of the repository */
|
|
40
|
+
url?: string;
|
|
41
|
+
[k: string]: unknown;
|
|
42
|
+
}[];
|
|
43
|
+
[k: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
[k: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare function serveExecutor(options: HelmPackageExecutorSchema, context: ExecutorContext, config?: StormConfig): Promise<{
|
|
49
|
+
success: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
declare const _default: PromiseExecutor<HelmPackageExecutorSchema>;
|
|
52
|
+
|
|
53
|
+
export { type HelmPackageExecutorSchema as H, _default as _, serveExecutor as s };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ExecutorContext, PromiseExecutor } from '@nx/devkit';
|
|
2
|
+
import { S as StormConfig } from './types-CIJRaFHD.js';
|
|
3
|
+
|
|
4
|
+
// Generated by @storm-software/untyped
|
|
5
|
+
// Do not edit this file directly
|
|
6
|
+
|
|
7
|
+
interface BaseExecutorSchema {
|
|
8
|
+
/**
|
|
9
|
+
* Output Path
|
|
10
|
+
*
|
|
11
|
+
* The output path for the build
|
|
12
|
+
*
|
|
13
|
+
* @default "dist/{projectRoot}"
|
|
14
|
+
*
|
|
15
|
+
* @format path
|
|
16
|
+
*/
|
|
17
|
+
outputPath?: string,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface HelmPackageExecutorSchema extends BaseExecutorSchema {
|
|
21
|
+
/** Folder where the chart is stored */
|
|
22
|
+
chartFolder: string;
|
|
23
|
+
/** Folder to store the packaged chart */
|
|
24
|
+
outputFolder: string;
|
|
25
|
+
/** Push the chart to a remote registry */
|
|
26
|
+
push?: boolean;
|
|
27
|
+
/** Remote registry to publish the chart */
|
|
28
|
+
remote?: string;
|
|
29
|
+
/** Options related to dependencies */
|
|
30
|
+
dependencies?: {
|
|
31
|
+
/** Runs `helm dependency update` before packaging */
|
|
32
|
+
update?: boolean;
|
|
33
|
+
/** Runs `helm dependency build` before packaging */
|
|
34
|
+
build?: boolean;
|
|
35
|
+
/** List of repositories to add with `helm repo add` before packaging */
|
|
36
|
+
repositories?: {
|
|
37
|
+
/** Name of the repository */
|
|
38
|
+
name?: string;
|
|
39
|
+
/** URL of the repository */
|
|
40
|
+
url?: string;
|
|
41
|
+
[k: string]: unknown;
|
|
42
|
+
}[];
|
|
43
|
+
[k: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
[k: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare function serveExecutor(options: HelmPackageExecutorSchema, context: ExecutorContext, config?: StormConfig): Promise<{
|
|
49
|
+
success: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
declare const _default: PromiseExecutor<HelmPackageExecutorSchema>;
|
|
52
|
+
|
|
53
|
+
export { type HelmPackageExecutorSchema as H, _default as _, serveExecutor as s };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getRegistryVersion } from './src/executors/container-publish/executor.mjs';
|
|
2
|
+
export { C as ContainerPublishExecutorSchema } from './schema.d-Cx_3iG9A.mjs';
|
|
3
|
+
export { H as HelmPackageExecutorSchema, s as serveExecutor } from './executor-DY-z8MOl.mjs';
|
|
4
|
+
import '@nx/devkit';
|
|
5
|
+
import './types-CIJRaFHD.mjs';
|
|
6
|
+
import 'zod';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getRegistryVersion } from './src/executors/container-publish/executor.js';
|
|
2
|
+
export { C as ContainerPublishExecutorSchema } from './schema.d-Cx_3iG9A.js';
|
|
3
|
+
export { H as HelmPackageExecutorSchema, s as serveExecutor } from './executor-Dr6UXfvX.js';
|
|
4
|
+
import '@nx/devkit';
|
|
5
|
+
import './types-CIJRaFHD.js';
|
|
6
|
+
import 'zod';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-XO66D74Z.js');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkXMPMWMWQjs = require('./chunk-XMPMWMWQ.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkEISL3C34js = require('./chunk-EISL3C34.js');
|
|
8
|
+
require('./chunk-UWJTAL4W.js');
|
|
9
|
+
require('./chunk-IOT45LXV.js');
|
|
10
|
+
require('./chunk-AFPEYAYK.js');
|
|
11
|
+
require('./chunk-GDXB64KG.js');
|
|
12
|
+
require('./chunk-2GAU2GHG.js');
|
|
13
|
+
require('./chunk-LFNGKV6F.js');
|
|
14
|
+
require('./chunk-EAQFLLRB.js');
|
|
15
|
+
require('./chunk-3GQAWCBQ.js');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
exports.getRegistryVersion = _chunkXMPMWMWQjs.getRegistryVersion; exports.serveExecutor = _chunkEISL3C34js.serveExecutor;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "./chunk-YSCEY447.mjs";
|
|
2
|
+
import {
|
|
3
|
+
getRegistryVersion
|
|
4
|
+
} from "./chunk-Q6DDBFXE.mjs";
|
|
5
|
+
import {
|
|
6
|
+
serveExecutor
|
|
7
|
+
} from "./chunk-7AV2CVBT.mjs";
|
|
8
|
+
import "./chunk-OBT35QXS.mjs";
|
|
9
|
+
import "./chunk-RVFKH45R.mjs";
|
|
10
|
+
import "./chunk-ZO7MGNKJ.mjs";
|
|
11
|
+
import "./chunk-DZ5UCMNL.mjs";
|
|
12
|
+
import "./chunk-6V45YKVB.mjs";
|
|
13
|
+
import "./chunk-UDLI3L7V.mjs";
|
|
14
|
+
import "./chunk-OA63SGD6.mjs";
|
|
15
|
+
import "./chunk-XUV4U54K.mjs";
|
|
16
|
+
export {
|
|
17
|
+
getRegistryVersion,
|
|
18
|
+
serveExecutor
|
|
19
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { B as BaseGeneratorSchema, a as BaseGeneratorResult } from './types-BCBFBwnJ.js';
|
|
2
|
+
import * as _nx_devkit from '@nx/devkit';
|
|
3
|
+
import { Tree } from '@nx/devkit';
|
|
4
|
+
import { S as StormConfig } from './types-CIJRaFHD.js';
|
|
5
|
+
|
|
6
|
+
interface HelmChartGeneratorSchema extends BaseGeneratorSchema {
|
|
7
|
+
/** Name of the chart */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Name of the project to add the chart to */
|
|
10
|
+
project: string;
|
|
11
|
+
/** Folder to store the chart */
|
|
12
|
+
chartFolder?: string;
|
|
13
|
+
/** Format the generated chart */
|
|
14
|
+
format?: boolean;
|
|
15
|
+
|
|
16
|
+
[k: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare function helmChartGeneratorFn(tree: Tree, options: HelmChartGeneratorSchema, config?: StormConfig): Promise<{
|
|
20
|
+
success: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
declare const _default: (tree: Tree, _options: HelmChartGeneratorSchema) => Promise<_nx_devkit.GeneratorCallback | BaseGeneratorResult>;
|
|
23
|
+
|
|
24
|
+
export { type HelmChartGeneratorSchema as H, _default as _, helmChartGeneratorFn as h };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { B as BaseGeneratorSchema, a as BaseGeneratorResult } from './types-BCBFBwnJ.mjs';
|
|
2
|
+
import * as _nx_devkit from '@nx/devkit';
|
|
3
|
+
import { Tree } from '@nx/devkit';
|
|
4
|
+
import { S as StormConfig } from './types-CIJRaFHD.mjs';
|
|
5
|
+
|
|
6
|
+
interface HelmDependencyGeneratorSchema extends BaseGeneratorSchema {
|
|
7
|
+
/** Project name */
|
|
8
|
+
project: string;
|
|
9
|
+
/** Chart Name of the Dependency */
|
|
10
|
+
chartName?: string;
|
|
11
|
+
/** Chart Version of the Dependency */
|
|
12
|
+
chartVersion?: string;
|
|
13
|
+
/** Repository of the Dependency */
|
|
14
|
+
repository: string;
|
|
15
|
+
/** Repository Name of the Dependency */
|
|
16
|
+
repositoryName: string;
|
|
17
|
+
/** Format the generated files */
|
|
18
|
+
format?: boolean;
|
|
19
|
+
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare function helmDependencyGeneratorFn(tree: Tree, options: HelmDependencyGeneratorSchema, config?: StormConfig): Promise<{
|
|
24
|
+
success: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
declare const _default: (tree: Tree, _options: HelmDependencyGeneratorSchema) => Promise<_nx_devkit.GeneratorCallback | BaseGeneratorResult>;
|
|
27
|
+
|
|
28
|
+
export { type HelmDependencyGeneratorSchema as H, _default as _, helmDependencyGeneratorFn as h };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { B as BaseGeneratorSchema, a as BaseGeneratorResult } from './types-BCBFBwnJ.mjs';
|
|
2
|
+
import * as _nx_devkit from '@nx/devkit';
|
|
3
|
+
import { Tree } from '@nx/devkit';
|
|
4
|
+
import { S as StormConfig } from './types-CIJRaFHD.mjs';
|
|
5
|
+
|
|
6
|
+
interface HelmChartGeneratorSchema extends BaseGeneratorSchema {
|
|
7
|
+
/** Name of the chart */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Name of the project to add the chart to */
|
|
10
|
+
project: string;
|
|
11
|
+
/** Folder to store the chart */
|
|
12
|
+
chartFolder?: string;
|
|
13
|
+
/** Format the generated chart */
|
|
14
|
+
format?: boolean;
|
|
15
|
+
|
|
16
|
+
[k: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare function helmChartGeneratorFn(tree: Tree, options: HelmChartGeneratorSchema, config?: StormConfig): Promise<{
|
|
20
|
+
success: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
declare const _default: (tree: Tree, _options: HelmChartGeneratorSchema) => Promise<_nx_devkit.GeneratorCallback | BaseGeneratorResult>;
|
|
23
|
+
|
|
24
|
+
export { type HelmChartGeneratorSchema as H, _default as _, helmChartGeneratorFn as h };
|