@catladder/cli 0.0.0-fix-add-missing-openssl-to-node-deploy-docker-4c13843a → 0.0.0-fix-docs-build-55bf5d63
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/dist/bundles/catenv/index.js +182 -40
- package/dist/bundles/cli/index.js +202 -61
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js +5 -3
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/index.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/index.js +6 -17
- package/dist/cli/src/apps/cli/commands/project/setup/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.d.ts +1 -0
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.js +9 -1
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.js.map +1 -1
- package/dist/cli/src/config/getProjectConfig.d.ts +1 -1
- package/dist/cli/src/config/getProjectConfig.js +7 -1
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/cli/src/utils/gitlab.js +1 -0
- package/dist/cli/src/utils/gitlab.js.map +1 -1
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js +3 -1
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js.map +1 -1
- package/dist/pipeline/src/build/base/index.d.ts +2 -3
- package/dist/pipeline/src/build/base/index.js.map +1 -1
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js +6 -4
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js.map +1 -1
- package/dist/pipeline/src/build/custom/buildJob.d.ts +2 -2
- package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/custom/index.d.ts +2 -2
- package/dist/pipeline/src/build/custom/index.js.map +1 -1
- package/dist/pipeline/src/build/custom/testJob.d.ts +2 -2
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- package/dist/pipeline/src/build/docker.d.ts +4 -4
- package/dist/pipeline/src/build/docker.js.map +1 -1
- package/dist/pipeline/src/build/index.d.ts +2 -2
- package/dist/pipeline/src/build/index.js +2 -2
- package/dist/pipeline/src/build/index.js.map +1 -1
- package/dist/pipeline/src/build/node/buildJob.d.ts +5 -3
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/node/index.d.ts +4 -4
- package/dist/pipeline/src/build/node/index.js.map +1 -1
- package/dist/pipeline/src/build/node/meteor.d.ts +2 -2
- package/dist/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/pipeline/src/build/node/yarn.d.ts +1 -1
- package/dist/pipeline/src/build/node/yarn.js +3 -1
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.d.ts +2 -2
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/index.d.ts +2 -2
- package/dist/pipeline/src/build/rails/index.js.map +1 -1
- package/dist/pipeline/src/build/sbom.d.ts +2 -2
- package/dist/pipeline/src/build/sbom.js.map +1 -1
- package/dist/pipeline/src/context/createComponentContext.js +17 -6
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/pipeline/src/context/getLabels.js +3 -1
- package/dist/pipeline/src/context/getLabels.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js +2 -2
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js +32 -7
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.d.ts +1 -2
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.js +3 -10
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/healthCheck.d.ts +5 -0
- package/dist/pipeline/src/deploy/cloudRun/createJobs/healthCheck.js +51 -0
- package/dist/pipeline/src/deploy/cloudRun/createJobs/healthCheck.js.map +1 -0
- package/dist/pipeline/src/deploy/cloudRun/utils/getJobOrServiceArgs.d.ts +2 -0
- package/dist/pipeline/src/deploy/cloudRun/utils/getJobOrServiceArgs.js +12 -0
- package/dist/pipeline/src/deploy/cloudRun/utils/getJobOrServiceArgs.js.map +1 -0
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +3 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
- package/dist/pipeline/src/deploy/sbom.js +4 -3
- package/dist/pipeline/src/deploy/sbom.js.map +1 -1
- package/dist/pipeline/src/deploy/types/googleCloudRun.d.ts +90 -0
- package/dist/pipeline/src/deploy/types/googleCloudRun.js +16 -0
- package/dist/pipeline/src/deploy/types/googleCloudRun.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +3 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
- package/dist/pipeline/src/types/config.d.ts +1 -1
- package/dist/pipeline/src/types/context.d.ts +6 -1
- package/dist/pipeline/src/types/context.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/cli/commands/project/commandSetup.ts +5 -3
- package/src/apps/cli/commands/project/setup/index.ts +9 -19
- package/src/apps/cli/commands/project/utils/autocompletions.ts +9 -0
- package/src/config/getProjectConfig.ts +12 -1
- package/src/utils/gitlab.ts +1 -0
|
@@ -1842,10 +1842,12 @@ exports["default"] = async (vorpal) => {
|
|
|
1842
1842
|
|
|
1843
1843
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1844
1844
|
const setup_1 = __nccwpck_require__(33309);
|
|
1845
|
+
const autocompletions_1 = __nccwpck_require__(39855);
|
|
1845
1846
|
exports["default"] = async (vorpal) => vorpal
|
|
1846
|
-
.command("project-setup", "Initializes all environments and creates requires resources, service accounts, etc.")
|
|
1847
|
-
.
|
|
1848
|
-
|
|
1847
|
+
.command("project-setup [component]", "Initializes all environments and creates requires resources, service accounts, etc.")
|
|
1848
|
+
.autocomplete(await (0, autocompletions_1.allComponents)())
|
|
1849
|
+
.action(async function ({ component }) {
|
|
1850
|
+
await (0, setup_1.setupProject)(this, component);
|
|
1849
1851
|
});
|
|
1850
1852
|
//# sourceMappingURL=commandSetup.js.map
|
|
1851
1853
|
|
|
@@ -1979,32 +1981,21 @@ exports["default"] = async (vorpal) => {
|
|
|
1979
1981
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1980
1982
|
exports.setupProject = void 0;
|
|
1981
1983
|
const getProjectConfig_1 = __nccwpck_require__(12145);
|
|
1982
|
-
const commandConfigSecrets_1 = __nccwpck_require__(23410);
|
|
1983
1984
|
const setupAccessTokens_1 = __nccwpck_require__(84195);
|
|
1984
1985
|
const setupContext_1 = __nccwpck_require__(44310);
|
|
1985
1986
|
const setupTopic_1 = __nccwpck_require__(84290);
|
|
1986
|
-
const setupProject = async (instance) => {
|
|
1987
|
-
const allContext = await (0, getProjectConfig_1.getAllPipelineContexts)();
|
|
1987
|
+
const setupProject = async (instance, onlyComponents) => {
|
|
1988
|
+
const allContext = await (0, getProjectConfig_1.getAllPipelineContexts)(onlyComponents);
|
|
1989
|
+
instance.log("will setup those contexts:");
|
|
1990
|
+
allContext.forEach((context) => {
|
|
1991
|
+
instance.log(` - ${context.name}:${context.env}`);
|
|
1992
|
+
});
|
|
1988
1993
|
for (const context of allContext) {
|
|
1989
1994
|
await (0, setupContext_1.setupContext)(instance, context);
|
|
1990
1995
|
}
|
|
1991
1996
|
await (0, setupAccessTokens_1.setupAccessTokens)(instance);
|
|
1992
1997
|
await (0, setupTopic_1.setupTopic)(instance);
|
|
1993
1998
|
instance.log("");
|
|
1994
|
-
const { configSecrets } = await instance.prompt({
|
|
1995
|
-
default: true,
|
|
1996
|
-
message: "Before deployments work, you need to config secrets. Do it now?",
|
|
1997
|
-
name: "configSecrets",
|
|
1998
|
-
type: "confirm",
|
|
1999
|
-
});
|
|
2000
|
-
instance.log("");
|
|
2001
|
-
if (configSecrets) {
|
|
2002
|
-
await (0, commandConfigSecrets_1.projectConfigSecrets)(instance);
|
|
2003
|
-
}
|
|
2004
|
-
else {
|
|
2005
|
-
instance.log("👆 don't forget to config secret using `project-config-secrets`");
|
|
2006
|
-
}
|
|
2007
|
-
instance.log("");
|
|
2008
1999
|
instance.log("gitlab is ready! 🥂");
|
|
2009
2000
|
instance.log("\n");
|
|
2010
2001
|
instance.log("do not forget to make sure that:");
|
|
@@ -2311,7 +2302,7 @@ exports.setupTopic = setupTopic;
|
|
|
2311
2302
|
"use strict";
|
|
2312
2303
|
|
|
2313
2304
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2314
|
-
exports.allEnvsAndAllComponents = exports.envAndComponents = exports.allEnvs = void 0;
|
|
2305
|
+
exports.allEnvsAndAllComponents = exports.envAndComponents = exports.allComponents = exports.allEnvs = void 0;
|
|
2315
2306
|
const pipeline_1 = __nccwpck_require__(10603);
|
|
2316
2307
|
const getProjectConfig_1 = __nccwpck_require__(12145);
|
|
2317
2308
|
const allEnvs = async () => {
|
|
@@ -2322,6 +2313,14 @@ const allEnvs = async () => {
|
|
|
2322
2313
|
return (0, pipeline_1.getAllEnvsInAllComponents)(config);
|
|
2323
2314
|
};
|
|
2324
2315
|
exports.allEnvs = allEnvs;
|
|
2316
|
+
const allComponents = async () => {
|
|
2317
|
+
const config = await (0, getProjectConfig_1.getProjectConfig)();
|
|
2318
|
+
if (!config) {
|
|
2319
|
+
return [];
|
|
2320
|
+
}
|
|
2321
|
+
return Object.keys(config.components);
|
|
2322
|
+
};
|
|
2323
|
+
exports.allComponents = allComponents;
|
|
2325
2324
|
const envAndComponents = async () => {
|
|
2326
2325
|
const allEnvAndcomponents = await (0, getProjectConfig_1.getAllComponentsWithAllEnvsFlat)();
|
|
2327
2326
|
return allEnvAndcomponents.reduce((acc, { env, componentName }) => [...acc, env + ":" + componentName], []);
|
|
@@ -2623,9 +2622,15 @@ const getAllComponentsWithAllEnvsHierarchical = async () => {
|
|
|
2623
2622
|
]));
|
|
2624
2623
|
};
|
|
2625
2624
|
exports.getAllComponentsWithAllEnvsHierarchical = getAllComponentsWithAllEnvsHierarchical;
|
|
2626
|
-
const getAllPipelineContexts = async () => {
|
|
2625
|
+
const getAllPipelineContexts = async (onlyComponent) => {
|
|
2626
|
+
const onlyComponentsArray = onlyComponent
|
|
2627
|
+
? Array.isArray(onlyComponent)
|
|
2628
|
+
? onlyComponent
|
|
2629
|
+
: [onlyComponent]
|
|
2630
|
+
: null;
|
|
2627
2631
|
return Promise.all((await (0, exports.getAllComponentsWithAllEnvsFlat)())
|
|
2628
2632
|
.filter((c) => c.env !== "local")
|
|
2633
|
+
.filter((c) => !onlyComponentsArray || onlyComponentsArray.includes(c.componentName))
|
|
2629
2634
|
.map(({ env, componentName }) => (0, exports.getPipelineContextByChoice)(env, componentName)));
|
|
2630
2635
|
};
|
|
2631
2636
|
exports.getAllPipelineContexts = getAllPipelineContexts;
|
|
@@ -3361,6 +3366,7 @@ const setupGitlabToken = async (vorpal) => {
|
|
|
3361
3366
|
vorpal.log("");
|
|
3362
3367
|
vorpal.log("☝ in order to access the api, we need a personal access token");
|
|
3363
3368
|
vorpal.log("Its best to create one specifically for catladder");
|
|
3369
|
+
vorpal.log("Scopes needed: api");
|
|
3364
3370
|
vorpal.log("");
|
|
3365
3371
|
vorpal.log("☝ we open up the settings page for you!");
|
|
3366
3372
|
vorpal.log("");
|
|
@@ -4245,7 +4251,9 @@ exports.createBuildJobArtifacts = createBuildJobArtifacts;
|
|
|
4245
4251
|
const getArtifactsPathForComponent = (c, additionalPaths) => {
|
|
4246
4252
|
var _a, _b;
|
|
4247
4253
|
return (_b = [
|
|
4248
|
-
...(
|
|
4254
|
+
...(c.build.type !== "disabled"
|
|
4255
|
+
? ((_a = c.build.config.artifactsPaths) !== null && _a !== void 0 ? _a : [])
|
|
4256
|
+
: []),
|
|
4249
4257
|
...(additionalPaths !== null && additionalPaths !== void 0 ? additionalPaths : []),
|
|
4250
4258
|
]) === null || _b === void 0 ? void 0 : _b.flatMap((artifact) => c.build
|
|
4251
4259
|
// in theory, we only need "direct",
|
|
@@ -4621,10 +4629,12 @@ const getAllCacheConfigsFromConfig = (context, configWithCache) => {
|
|
|
4621
4629
|
// we would probably need to introduce a path to the right config property (build-->test or so)
|
|
4622
4630
|
context.components.flatMap((componentContext) => {
|
|
4623
4631
|
var _a;
|
|
4624
|
-
return
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4632
|
+
return componentContext.build.type !== "disabled"
|
|
4633
|
+
? ((_a = (0, index_1.ensureArray)(componentContext.build.config.cache).map((c) => ({
|
|
4634
|
+
...c,
|
|
4635
|
+
baseDir: componentContext.build.dir,
|
|
4636
|
+
}))) !== null && _a !== void 0 ? _a : [])
|
|
4637
|
+
: [];
|
|
4628
4638
|
})
|
|
4629
4639
|
: []),
|
|
4630
4640
|
];
|
|
@@ -5017,8 +5027,8 @@ exports.BUILD_TYPES = {
|
|
|
5017
5027
|
defaults: () => ({
|
|
5018
5028
|
startCommand: "/cnb/process/web",
|
|
5019
5029
|
cnbBuilder: {
|
|
5020
|
-
image: "heroku/builder:
|
|
5021
|
-
packVersion: "0.
|
|
5030
|
+
image: "heroku/builder:24",
|
|
5031
|
+
packVersion: "0.36.4",
|
|
5022
5032
|
},
|
|
5023
5033
|
}),
|
|
5024
5034
|
},
|
|
@@ -5392,7 +5402,9 @@ const ensureNodeVersion = (context) => (0, gitlab_1.collapseableSection)("nodein
|
|
|
5392
5402
|
]);
|
|
5393
5403
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
5394
5404
|
const getYarnInstall = (context, options) => {
|
|
5395
|
-
const postInstall = context.type !== "workspace" &&
|
|
5405
|
+
const postInstall = context.type !== "workspace" &&
|
|
5406
|
+
context.build.type !== "disabled" &&
|
|
5407
|
+
"postInstall" in context.build.config
|
|
5396
5408
|
? context.build.config.postInstall
|
|
5397
5409
|
: null;
|
|
5398
5410
|
return [
|
|
@@ -5850,19 +5862,23 @@ const createComponentContext = async (ctx) => {
|
|
|
5850
5862
|
const packageManagerInfo = await (0, packageManager_1.getPackageManagerInfoForComponent)(ctx.config, ctx.componentName);
|
|
5851
5863
|
const envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
5852
5864
|
const componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
5853
|
-
const resolvedBuildType =
|
|
5854
|
-
?
|
|
5855
|
-
: (
|
|
5856
|
-
|
|
5865
|
+
const resolvedBuildType = componentConfigWithoutDefaults.build === false
|
|
5866
|
+
? false
|
|
5867
|
+
: (0, build_1.isStandaloneBuildConfig)(componentConfigWithoutDefaults.build)
|
|
5868
|
+
? componentConfigWithoutDefaults.build.type
|
|
5869
|
+
: (_a = ctx.config.builds) === null || _a === void 0 ? void 0 : _a[componentConfigWithoutDefaults.build.from].type;
|
|
5870
|
+
if (resolvedBuildType === undefined) {
|
|
5857
5871
|
throw new Error("build type not found, is the build config correct?");
|
|
5858
5872
|
}
|
|
5859
5873
|
const defaults = componentConfigWithoutDefaults.deploy
|
|
5860
5874
|
? {
|
|
5861
|
-
build:
|
|
5875
|
+
build: resolvedBuildType &&
|
|
5876
|
+
build_1.BUILD_TYPES[resolvedBuildType].defaults(envContext),
|
|
5862
5877
|
deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults(envContext),
|
|
5863
5878
|
}
|
|
5864
5879
|
: {
|
|
5865
|
-
build:
|
|
5880
|
+
build: resolvedBuildType &&
|
|
5881
|
+
build_1.BUILD_TYPES[resolvedBuildType].defaults(envContext),
|
|
5866
5882
|
deploy: {},
|
|
5867
5883
|
};
|
|
5868
5884
|
const componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
@@ -5880,6 +5896,13 @@ const createComponentContext = async (ctx) => {
|
|
|
5880
5896
|
};
|
|
5881
5897
|
const _getBuildContext = () => {
|
|
5882
5898
|
var _a;
|
|
5899
|
+
if (build === false) {
|
|
5900
|
+
return {
|
|
5901
|
+
type: "disabled",
|
|
5902
|
+
getComponentDirs,
|
|
5903
|
+
dir,
|
|
5904
|
+
};
|
|
5905
|
+
}
|
|
5883
5906
|
if ((0, build_1.isStandaloneBuildConfig)(build)) {
|
|
5884
5907
|
return {
|
|
5885
5908
|
dir: dir,
|
|
@@ -6296,7 +6319,9 @@ const getLabels = (context) => {
|
|
|
6296
6319
|
"app-name": sanitize(context.fullConfig.appName),
|
|
6297
6320
|
"env-type": sanitize(context.environment.envType),
|
|
6298
6321
|
"env-name": sanitize(context.env),
|
|
6299
|
-
"build-type":
|
|
6322
|
+
"build-type": context.build.type === "disabled"
|
|
6323
|
+
? "disabled"
|
|
6324
|
+
: sanitize(context.build.buildType),
|
|
6300
6325
|
...((_b = (_a = context.fullConfig.meta) === null || _a === void 0 ? void 0 : _a.labels) !== null && _b !== void 0 ? _b : {}),
|
|
6301
6326
|
};
|
|
6302
6327
|
return labels;
|
|
@@ -6890,7 +6915,7 @@ const jobName_1 = __nccwpck_require__(9626);
|
|
|
6890
6915
|
const common_1 = __nccwpck_require__(73325);
|
|
6891
6916
|
const constants_1 = __nccwpck_require__(38865);
|
|
6892
6917
|
const volumes_1 = __nccwpck_require__(60847);
|
|
6893
|
-
const
|
|
6918
|
+
const getJobOrServiceArgs_1 = __nccwpck_require__(61741);
|
|
6894
6919
|
const getDeleteJobsScripts = (context) => {
|
|
6895
6920
|
const commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
6896
6921
|
const commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
@@ -6910,7 +6935,7 @@ const getJobCreateScripts = (context) => (0, exports.getCloudRunJobsWithNames)(c
|
|
|
6910
6935
|
const { image: commonImage, project, region, ...deployArgs } = (0, common_1.getCommonDeployArgs)(context);
|
|
6911
6936
|
const commonDeployArgsString = (0, createArgsString_1.createArgsString)({
|
|
6912
6937
|
command: `"${commandArray.join(",")}"`,
|
|
6913
|
-
args: (0,
|
|
6938
|
+
args: (0, getJobOrServiceArgs_1.getCloudRunServiceOrJobArgsArg)(job.args),
|
|
6914
6939
|
labels: `"${(0, common_1.makeLabelString)((0, getLabels_1.getLabels)(context))},cloud-run-job-name=$current_job_name"`,
|
|
6915
6940
|
image: `"${(_a = job.image) !== null && _a !== void 0 ? _a : commonImage}"`,
|
|
6916
6941
|
project,
|
|
@@ -6970,17 +6995,21 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
6970
6995
|
exports.getServiceDeleteScript = exports.getServiceDeployScript = void 0;
|
|
6971
6996
|
const getLabels_1 = __nccwpck_require__(30920);
|
|
6972
6997
|
const createArgsString_1 = __nccwpck_require__(49598);
|
|
6998
|
+
const getJobOrServiceArgs_1 = __nccwpck_require__(61741);
|
|
6973
6999
|
const getServiceName_1 = __nccwpck_require__(38128);
|
|
6974
7000
|
const common_1 = __nccwpck_require__(73325);
|
|
6975
7001
|
const constants_1 = __nccwpck_require__(38865);
|
|
7002
|
+
const healthCheck_1 = __nccwpck_require__(30193);
|
|
6976
7003
|
const volumes_1 = __nccwpck_require__(60847);
|
|
6977
7004
|
const getServiceDeployScript = (context, service, nameSuffix) => {
|
|
6978
|
-
var _a, _b, _c, _d, _e;
|
|
7005
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6979
7006
|
const commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
|
|
6980
7007
|
const serviceName = (0, getServiceName_1.getServiceName)(context);
|
|
6981
7008
|
const customConfig = service !== true ? service : undefined;
|
|
6982
7009
|
const command = service !== true
|
|
6983
|
-
? ((_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.build.
|
|
7010
|
+
? ((_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : (context.build.type !== "disabled"
|
|
7011
|
+
? context.build.config.startCommand
|
|
7012
|
+
: undefined))
|
|
6984
7013
|
: undefined;
|
|
6985
7014
|
const commandArray = command
|
|
6986
7015
|
? Array.isArray(command)
|
|
@@ -6991,14 +7020,16 @@ const getServiceDeployScript = (context, service, nameSuffix) => {
|
|
|
6991
7020
|
const argsString = (0, createArgsString_1.createArgsString)({
|
|
6992
7021
|
// command as empty string resets it to default (uses the image's entrypoint)
|
|
6993
7022
|
command: commandArray ? '"' + commandArray.join(",") + '"' : '""',
|
|
7023
|
+
args: (0, getJobOrServiceArgs_1.getCloudRunServiceOrJobArgsArg)(customConfig === null || customConfig === void 0 ? void 0 : customConfig.args),
|
|
6994
7024
|
...commonDeployArgs,
|
|
7025
|
+
image: (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.image) !== null && _b !== void 0 ? _b : commonDeployArgs.image,
|
|
6995
7026
|
labels: (0, common_1.makeLabelString)({
|
|
6996
7027
|
...(0, getLabels_1.getLabels)(context),
|
|
6997
7028
|
"cloud-run-service-name": fullServiceName,
|
|
6998
7029
|
}),
|
|
6999
7030
|
"env-vars-file": constants_1.ENV_VARS_FILENAME,
|
|
7000
|
-
"min-instances": (
|
|
7001
|
-
"max-instances": (
|
|
7031
|
+
"min-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _c !== void 0 ? _c : 0,
|
|
7032
|
+
"max-instances": (_d = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _d !== void 0 ? _d : 100,
|
|
7002
7033
|
"cpu-throttling": (customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling) !== true,
|
|
7003
7034
|
cpu: customConfig === null || customConfig === void 0 ? void 0 : customConfig.cpu,
|
|
7004
7035
|
memory: customConfig === null || customConfig === void 0 ? void 0 : customConfig.memory,
|
|
@@ -7008,12 +7039,16 @@ const getServiceDeployScript = (context, service, nameSuffix) => {
|
|
|
7008
7039
|
network: customConfig === null || customConfig === void 0 ? void 0 : customConfig.network,
|
|
7009
7040
|
subnet: customConfig === null || customConfig === void 0 ? void 0 : customConfig.subnet,
|
|
7010
7041
|
"use-http2": customConfig === null || customConfig === void 0 ? void 0 : customConfig.http2,
|
|
7011
|
-
"allow-unauthenticated": (
|
|
7012
|
-
ingress: (
|
|
7042
|
+
"allow-unauthenticated": (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.allowUnauthenticated) !== null && _e !== void 0 ? _e : true,
|
|
7043
|
+
ingress: (_f = customConfig === null || customConfig === void 0 ? void 0 : customConfig.ingress) !== null && _f !== void 0 ? _f : "all",
|
|
7013
7044
|
"cpu-boost": true,
|
|
7014
7045
|
"execution-environment": customConfig === null || customConfig === void 0 ? void 0 : customConfig.executionEnvironment,
|
|
7046
|
+
gpu: customConfig === null || customConfig === void 0 ? void 0 : customConfig.gpu,
|
|
7047
|
+
"gpu-type": customConfig === null || customConfig === void 0 ? void 0 : customConfig.gpuType,
|
|
7048
|
+
...(0, healthCheck_1.healthCheckCliArgs)(customConfig === null || customConfig === void 0 ? void 0 : customConfig.healthCheck),
|
|
7015
7049
|
}, ...(0, volumes_1.createVolumeConfig)(customConfig === null || customConfig === void 0 ? void 0 : customConfig.volumes, "service"));
|
|
7016
|
-
|
|
7050
|
+
const version = requiresBeta(customConfig) ? "beta" : undefined;
|
|
7051
|
+
return `${(0, common_1.gcloudRunCmd)(version)} deploy ${fullServiceName} ${argsString}`;
|
|
7017
7052
|
};
|
|
7018
7053
|
exports.getServiceDeployScript = getServiceDeployScript;
|
|
7019
7054
|
const getServiceDeleteScript = (context, serviceSuffix) => {
|
|
@@ -7028,6 +7063,21 @@ const getServiceDeleteScript = (context, serviceSuffix) => {
|
|
|
7028
7063
|
];
|
|
7029
7064
|
};
|
|
7030
7065
|
exports.getServiceDeleteScript = getServiceDeleteScript;
|
|
7066
|
+
const requiresBeta = (config) => {
|
|
7067
|
+
if (!config) {
|
|
7068
|
+
return false;
|
|
7069
|
+
}
|
|
7070
|
+
if (config.gpuType) {
|
|
7071
|
+
return true;
|
|
7072
|
+
}
|
|
7073
|
+
if (config.gpu && config.gpu > 0) {
|
|
7074
|
+
return true;
|
|
7075
|
+
}
|
|
7076
|
+
if (config.healthCheck !== undefined) {
|
|
7077
|
+
return true;
|
|
7078
|
+
}
|
|
7079
|
+
return false;
|
|
7080
|
+
};
|
|
7031
7081
|
//# sourceMappingURL=cloudRunServices.js.map
|
|
7032
7082
|
|
|
7033
7083
|
/***/ }),
|
|
@@ -7114,8 +7164,9 @@ exports.ENV_VARS_FILENAME = "____envvars.yaml";
|
|
|
7114
7164
|
"use strict";
|
|
7115
7165
|
|
|
7116
7166
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7117
|
-
exports.
|
|
7167
|
+
exports.getOnDeployExecuteScript = void 0;
|
|
7118
7168
|
const createArgsString_1 = __nccwpck_require__(49598);
|
|
7169
|
+
const getJobOrServiceArgs_1 = __nccwpck_require__(61741);
|
|
7119
7170
|
const jobName_1 = __nccwpck_require__(9626);
|
|
7120
7171
|
const cloudRunJobs_1 = __nccwpck_require__(61224);
|
|
7121
7172
|
const common_1 = __nccwpck_require__(73325);
|
|
@@ -7183,19 +7234,11 @@ const getJobRunScriptForExecute = (context, { jobName, config }) => {
|
|
|
7183
7234
|
const argString = (0, createArgsString_1.createArgsString)({
|
|
7184
7235
|
...commonArgs,
|
|
7185
7236
|
wait: waitForCompletion === true ? true : undefined,
|
|
7186
|
-
args: (0,
|
|
7237
|
+
args: (0, getJobOrServiceArgs_1.getCloudRunServiceOrJobArgsArg)(config.args),
|
|
7187
7238
|
});
|
|
7188
7239
|
const fullJobName = (0, jobName_1.getFullJobName)(context, jobName);
|
|
7189
7240
|
return `${(0, common_1.gcloudRunCmd)()} jobs execute ${fullJobName.toString()} ${argString}`;
|
|
7190
7241
|
};
|
|
7191
|
-
const getCloudRunJobArgsArg = (args) => {
|
|
7192
|
-
return args !== undefined
|
|
7193
|
-
? args.length > 0
|
|
7194
|
-
? args === null || args === void 0 ? void 0 : args.map((arg) => `"${arg}"`).join(",")
|
|
7195
|
-
: ""
|
|
7196
|
-
: undefined;
|
|
7197
|
-
};
|
|
7198
|
-
exports.getCloudRunJobArgsArg = getCloudRunJobArgsArg;
|
|
7199
7242
|
//# sourceMappingURL=onDeploy.js.map
|
|
7200
7243
|
|
|
7201
7244
|
/***/ }),
|
|
@@ -7435,6 +7478,64 @@ exports.getCloudRunStopScripts = getCloudRunStopScripts;
|
|
|
7435
7478
|
|
|
7436
7479
|
/***/ }),
|
|
7437
7480
|
|
|
7481
|
+
/***/ 30193:
|
|
7482
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
7483
|
+
|
|
7484
|
+
"use strict";
|
|
7485
|
+
|
|
7486
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7487
|
+
exports.healthCheckCliArgs = void 0;
|
|
7488
|
+
const types_1 = __nccwpck_require__(75781);
|
|
7489
|
+
const PORT = 8080;
|
|
7490
|
+
function healthCheckCliArgs(healthCheck) {
|
|
7491
|
+
const shouldNotSetHealthCheck = healthCheck === undefined;
|
|
7492
|
+
if (shouldNotSetHealthCheck) {
|
|
7493
|
+
return undefined;
|
|
7494
|
+
}
|
|
7495
|
+
const shouldUseDefaultProbe = healthCheck === true;
|
|
7496
|
+
if (shouldUseDefaultProbe) {
|
|
7497
|
+
return {
|
|
7498
|
+
"startup-probe": toArgValue(probeToKeyValuePairs(types_1.defaultStartupProbe)),
|
|
7499
|
+
"liveness-probe": toArgValue(probeToKeyValuePairs(types_1.defaultLivenessProbe)),
|
|
7500
|
+
};
|
|
7501
|
+
}
|
|
7502
|
+
return {
|
|
7503
|
+
"startup-probe": toArgValue(probeToKeyValuePairs(healthCheck.startupProbe)),
|
|
7504
|
+
"liveness-probe": healthCheck.livenessProbe
|
|
7505
|
+
? toArgValue(probeToKeyValuePairs(healthCheck.livenessProbe))
|
|
7506
|
+
: "", // NOTE: empty string ("") removes liveness probe
|
|
7507
|
+
};
|
|
7508
|
+
}
|
|
7509
|
+
exports.healthCheckCliArgs = healthCheckCliArgs;
|
|
7510
|
+
function probeToKeyValuePairs(probe) {
|
|
7511
|
+
const sharedArgs = Object.entries({
|
|
7512
|
+
initialDelaySeconds: probe.initialDelaySeconds,
|
|
7513
|
+
timeoutSeconds: probe.timeoutSeconds,
|
|
7514
|
+
periodSeconds: probe.periodSeconds,
|
|
7515
|
+
failureThreshold: probe.failureThreshold,
|
|
7516
|
+
});
|
|
7517
|
+
switch (probe.type) {
|
|
7518
|
+
case "tcp":
|
|
7519
|
+
return [...sharedArgs, ["tcpSocket.port", PORT]];
|
|
7520
|
+
case "http1":
|
|
7521
|
+
return [
|
|
7522
|
+
...sharedArgs,
|
|
7523
|
+
["httpGet.port", PORT],
|
|
7524
|
+
["httpGet.path", probe.path],
|
|
7525
|
+
// NOTE: headers are not supported by "gcloud beta" at the moment
|
|
7526
|
+
];
|
|
7527
|
+
default:
|
|
7528
|
+
probe;
|
|
7529
|
+
return [];
|
|
7530
|
+
}
|
|
7531
|
+
}
|
|
7532
|
+
function toArgValue(keyValues) {
|
|
7533
|
+
return keyValues.map(([key, value]) => `${key}=${value}`).join(",");
|
|
7534
|
+
}
|
|
7535
|
+
//# sourceMappingURL=healthCheck.js.map
|
|
7536
|
+
|
|
7537
|
+
/***/ }),
|
|
7538
|
+
|
|
7438
7539
|
/***/ 34069:
|
|
7439
7540
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
7440
7541
|
|
|
@@ -7740,6 +7841,25 @@ exports.gcloudServiceAccountLoginCommands = gcloudServiceAccountLoginCommands;
|
|
|
7740
7841
|
|
|
7741
7842
|
/***/ }),
|
|
7742
7843
|
|
|
7844
|
+
/***/ 61741:
|
|
7845
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
7846
|
+
|
|
7847
|
+
"use strict";
|
|
7848
|
+
|
|
7849
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7850
|
+
exports.getCloudRunServiceOrJobArgsArg = void 0;
|
|
7851
|
+
const getCloudRunServiceOrJobArgsArg = (args) => {
|
|
7852
|
+
return args !== undefined
|
|
7853
|
+
? args.length > 0
|
|
7854
|
+
? args === null || args === void 0 ? void 0 : args.map((arg) => `"${arg}"`).join(",")
|
|
7855
|
+
: ""
|
|
7856
|
+
: undefined;
|
|
7857
|
+
};
|
|
7858
|
+
exports.getCloudRunServiceOrJobArgsArg = getCloudRunServiceOrJobArgsArg;
|
|
7859
|
+
//# sourceMappingURL=getJobOrServiceArgs.js.map
|
|
7860
|
+
|
|
7861
|
+
/***/ }),
|
|
7862
|
+
|
|
7743
7863
|
/***/ 38128:
|
|
7744
7864
|
/***/ ((__unused_webpack_module, exports) => {
|
|
7745
7865
|
|
|
@@ -8282,7 +8402,9 @@ const createAppConfig = (context, application) => {
|
|
|
8282
8402
|
const { healthRoute, command, ...rest } = application !== null && application !== void 0 ? application : {};
|
|
8283
8403
|
return (0, utils_1.mergeWithMergingArrays)({
|
|
8284
8404
|
host: context.environment.envVars.HOSTNAME,
|
|
8285
|
-
command: command !== null && command !== void 0 ? command : context.build.
|
|
8405
|
+
command: command !== null && command !== void 0 ? command : (context.build.type !== "disabled"
|
|
8406
|
+
? context.build.config.startCommand
|
|
8407
|
+
: undefined),
|
|
8286
8408
|
livenessProbe: {
|
|
8287
8409
|
httpGet: {
|
|
8288
8410
|
path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health",
|
|
@@ -8462,9 +8584,10 @@ exports.getDependencyTrackDeleteScript = exports.getDependencyTrackUploadScript
|
|
|
8462
8584
|
const BashExpression_1 = __nccwpck_require__(42376);
|
|
8463
8585
|
const sbom_1 = __nccwpck_require__(37038);
|
|
8464
8586
|
const context_1 = __nccwpck_require__(61724);
|
|
8465
|
-
const sbomDeactivated = (context) =>
|
|
8466
|
-
context
|
|
8467
|
-
|
|
8587
|
+
const sbomDeactivated = (context) => context.build.type === "disabled" ||
|
|
8588
|
+
((0, context_1.componentContextIsStandaloneBuild)(context) &&
|
|
8589
|
+
context.build.config.type === "custom" &&
|
|
8590
|
+
context.build.config.sbom === false);
|
|
8468
8591
|
exports.sbomDeactivated = sbomDeactivated;
|
|
8469
8592
|
const getDependencyTrackUploadScript = (context) => {
|
|
8470
8593
|
return (0, exports.sbomDeactivated)(context)
|
|
@@ -8514,6 +8637,22 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
8514
8637
|
"use strict";
|
|
8515
8638
|
|
|
8516
8639
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8640
|
+
exports.defaultLivenessProbe = exports.defaultStartupProbe = void 0;
|
|
8641
|
+
exports.defaultStartupProbe = {
|
|
8642
|
+
type: "http1",
|
|
8643
|
+
path: "/__health",
|
|
8644
|
+
initialDelaySeconds: 5,
|
|
8645
|
+
timeoutSeconds: 1,
|
|
8646
|
+
periodSeconds: 30,
|
|
8647
|
+
failureThreshold: 3,
|
|
8648
|
+
};
|
|
8649
|
+
exports.defaultLivenessProbe = {
|
|
8650
|
+
...exports.defaultStartupProbe,
|
|
8651
|
+
initialDelaySeconds: 0,
|
|
8652
|
+
timeoutSeconds: 10,
|
|
8653
|
+
periodSeconds: 30,
|
|
8654
|
+
failureThreshold: 3,
|
|
8655
|
+
};
|
|
8517
8656
|
//# sourceMappingURL=googleCloudRun.js.map
|
|
8518
8657
|
|
|
8519
8658
|
/***/ }),
|
|
@@ -8757,7 +8896,9 @@ const getCustomJobs = (context) => {
|
|
|
8757
8896
|
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
8758
8897
|
};
|
|
8759
8898
|
const createJobsForComponentContext = (context) => {
|
|
8760
|
-
const buildJobs =
|
|
8899
|
+
const buildJobs = context.build.type !== "disabled"
|
|
8900
|
+
? build_1.BUILD_TYPES[context.build.buildType].jobs(context)
|
|
8901
|
+
: [];
|
|
8761
8902
|
const deployJobs = context.componentConfig.deploy !== false
|
|
8762
8903
|
? deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context)
|
|
8763
8904
|
: [];
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const setup_1 = require("./setup");
|
|
4
|
+
const autocompletions_1 = require("./utils/autocompletions");
|
|
4
5
|
exports.default = async (vorpal) => vorpal
|
|
5
|
-
.command("project-setup", "Initializes all environments and creates requires resources, service accounts, etc.")
|
|
6
|
-
.
|
|
7
|
-
|
|
6
|
+
.command("project-setup [component]", "Initializes all environments and creates requires resources, service accounts, etc.")
|
|
7
|
+
.autocomplete(await (0, autocompletions_1.allComponents)())
|
|
8
|
+
.action(async function ({ component }) {
|
|
9
|
+
await (0, setup_1.setupProject)(this, component);
|
|
8
10
|
});
|
|
9
11
|
//# sourceMappingURL=commandSetup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandSetup.js","sourceRoot":"","sources":["../../../../../../../src/apps/cli/commands/project/commandSetup.ts"],"names":[],"mappings":";;AACA,mCAAuC;
|
|
1
|
+
{"version":3,"file":"commandSetup.js","sourceRoot":"","sources":["../../../../../../../src/apps/cli/commands/project/commandSetup.ts"],"names":[],"mappings":";;AACA,mCAAuC;AACvC,6DAAwD;AAExD,kBAAe,KAAK,EAAE,MAAc,EAAE,EAAE,CACtC,MAAM;KACH,OAAO,CACN,2BAA2B,EAC3B,qFAAqF,CACtF;KACA,YAAY,CAAC,MAAM,IAAA,+BAAa,GAAE,CAAC;KACnC,MAAM,CAAC,KAAK,WAAW,EAAE,SAAS,EAAE;IACnC,MAAM,IAAA,oBAAY,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CommandInstance } from "vorpal";
|
|
2
|
-
export declare const setupProject: (instance: CommandInstance) => Promise<void>;
|
|
2
|
+
export declare const setupProject: (instance: CommandInstance, onlyComponents?: string | string[]) => Promise<void>;
|
|
@@ -2,32 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setupProject = void 0;
|
|
4
4
|
const getProjectConfig_1 = require("../../../../../config/getProjectConfig");
|
|
5
|
-
const commandConfigSecrets_1 = require("../commandConfigSecrets");
|
|
6
5
|
const setupAccessTokens_1 = require("./setupAccessTokens");
|
|
7
6
|
const setupContext_1 = require("./setupContext");
|
|
8
7
|
const setupTopic_1 = require("./setupTopic");
|
|
9
|
-
const setupProject = async (instance) => {
|
|
10
|
-
const allContext = await (0, getProjectConfig_1.getAllPipelineContexts)();
|
|
8
|
+
const setupProject = async (instance, onlyComponents) => {
|
|
9
|
+
const allContext = await (0, getProjectConfig_1.getAllPipelineContexts)(onlyComponents);
|
|
10
|
+
instance.log("will setup those contexts:");
|
|
11
|
+
allContext.forEach((context) => {
|
|
12
|
+
instance.log(` - ${context.name}:${context.env}`);
|
|
13
|
+
});
|
|
11
14
|
for (const context of allContext) {
|
|
12
15
|
await (0, setupContext_1.setupContext)(instance, context);
|
|
13
16
|
}
|
|
14
17
|
await (0, setupAccessTokens_1.setupAccessTokens)(instance);
|
|
15
18
|
await (0, setupTopic_1.setupTopic)(instance);
|
|
16
19
|
instance.log("");
|
|
17
|
-
const { configSecrets } = await instance.prompt({
|
|
18
|
-
default: true,
|
|
19
|
-
message: "Before deployments work, you need to config secrets. Do it now?",
|
|
20
|
-
name: "configSecrets",
|
|
21
|
-
type: "confirm",
|
|
22
|
-
});
|
|
23
|
-
instance.log("");
|
|
24
|
-
if (configSecrets) {
|
|
25
|
-
await (0, commandConfigSecrets_1.projectConfigSecrets)(instance);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
instance.log("👆 don't forget to config secret using `project-config-secrets`");
|
|
29
|
-
}
|
|
30
|
-
instance.log("");
|
|
31
20
|
instance.log("gitlab is ready! 🥂");
|
|
32
21
|
instance.log("\n");
|
|
33
22
|
instance.log("do not forget to make sure that:");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/apps/cli/commands/project/setup/index.ts"],"names":[],"mappings":";;;AACA,6EAAgF;AAChF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/apps/cli/commands/project/setup/index.ts"],"names":[],"mappings":";;;AACA,6EAAgF;AAChF,2DAAwD;AACxD,iDAA8C;AAC9C,6CAA0C;AAEnC,MAAM,YAAY,GAAG,KAAK,EAC/B,QAAyB,EACzB,cAAkC,EAClC,EAAE;IACF,MAAM,UAAU,GAAG,MAAM,IAAA,yCAAsB,EAAC,cAAc,CAAC,CAAC;IAChE,QAAQ,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC3C,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,QAAQ,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IACH,KAAK,MAAM,OAAO,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,IAAA,2BAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,IAAA,qCAAiB,EAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,IAAA,uBAAU,EAAC,QAAQ,CAAC,CAAC;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACpC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnB,QAAQ,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IACjD;QACE,kCAAkC;QAClC,2BAA2B;QAC3B,qDAAqD;QACrD,qBAAqB;QACrB,eAAe;KAChB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;IAC9C,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnB,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC,CAAC;AA3BW,QAAA,YAAY,gBA2BvB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.allEnvsAndAllComponents = exports.envAndComponents = exports.allEnvs = void 0;
|
|
3
|
+
exports.allEnvsAndAllComponents = exports.envAndComponents = exports.allComponents = exports.allEnvs = void 0;
|
|
4
4
|
const pipeline_1 = require("../../../../../../../pipeline/src/index.js");
|
|
5
5
|
const getProjectConfig_1 = require("../../../../../config/getProjectConfig");
|
|
6
6
|
const allEnvs = async () => {
|
|
@@ -11,6 +11,14 @@ const allEnvs = async () => {
|
|
|
11
11
|
return (0, pipeline_1.getAllEnvsInAllComponents)(config);
|
|
12
12
|
};
|
|
13
13
|
exports.allEnvs = allEnvs;
|
|
14
|
+
const allComponents = async () => {
|
|
15
|
+
const config = await (0, getProjectConfig_1.getProjectConfig)();
|
|
16
|
+
if (!config) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
return Object.keys(config.components);
|
|
20
|
+
};
|
|
21
|
+
exports.allComponents = allComponents;
|
|
14
22
|
const envAndComponents = async () => {
|
|
15
23
|
const allEnvAndcomponents = await (0, getProjectConfig_1.getAllComponentsWithAllEnvsFlat)();
|
|
16
24
|
return allEnvAndcomponents.reduce((acc, { env, componentName }) => [...acc, env + ":" + componentName], []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocompletions.js","sourceRoot":"","sources":["../../../../../../../../src/apps/cli/commands/project/utils/autocompletions.ts"],"names":[],"mappings":";;;AAAA,kDAA4E;AAC5E,6EAGgD;AAEzC,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;IAChC,MAAM,MAAM,GAAG,MAAM,IAAA,mCAAgB,GAAE,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,IAAA,oCAAyB,EAAC,MAAM,CAAC,CAAC;AAC3C,CAAC,CAAC;AANW,QAAA,OAAO,WAMlB;AAEK,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;IACzC,MAAM,mBAAmB,GAAG,MAAM,IAAA,kDAA+B,GAAE,CAAC;IAEpE,OAAO,mBAAmB,CAAC,MAAM,CAC/B,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,aAAa,CAAC,EACpE,EAAE,CACH,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B;AAEK,MAAM,uBAAuB,GAAG,KAAK,IAAI,EAAE;IAChD,OAAO,CAAC,GAAG,CAAC,MAAM,IAAA,eAAO,GAAE,CAAC,EAAE,GAAG,CAAC,MAAM,IAAA,wBAAgB,GAAE,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC"}
|
|
1
|
+
{"version":3,"file":"autocompletions.js","sourceRoot":"","sources":["../../../../../../../../src/apps/cli/commands/project/utils/autocompletions.ts"],"names":[],"mappings":";;;AAAA,kDAA4E;AAC5E,6EAGgD;AAEzC,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;IAChC,MAAM,MAAM,GAAG,MAAM,IAAA,mCAAgB,GAAE,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,IAAA,oCAAyB,EAAC,MAAM,CAAC,CAAC;AAC3C,CAAC,CAAC;AANW,QAAA,OAAO,WAMlB;AAEK,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;IACtC,MAAM,MAAM,GAAG,MAAM,IAAA,mCAAgB,GAAE,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACxC,CAAC,CAAC;AAPW,QAAA,aAAa,iBAOxB;AAEK,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;IACzC,MAAM,mBAAmB,GAAG,MAAM,IAAA,kDAA+B,GAAE,CAAC;IAEpE,OAAO,mBAAmB,CAAC,MAAM,CAC/B,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,aAAa,CAAC,EACpE,EAAE,CACH,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B;AAEK,MAAM,uBAAuB,GAAG,KAAK,IAAI,EAAE;IAChD,OAAO,CAAC,GAAG,CAAC,MAAM,IAAA,eAAO,GAAE,CAAC,EAAE,GAAG,CAAC,MAAM,IAAA,wBAAgB,GAAE,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC"}
|
|
@@ -11,7 +11,7 @@ export declare const getAllComponentsWithAllEnvsFlat: () => Promise<Array<{
|
|
|
11
11
|
export declare const getAllComponentsWithAllEnvsHierarchical: () => Promise<{
|
|
12
12
|
[componentName: string]: string[];
|
|
13
13
|
}>;
|
|
14
|
-
export declare const getAllPipelineContexts: () => Promise<import("../../../pipeline/src/index.js").ComponentContext[]>;
|
|
14
|
+
export declare const getAllPipelineContexts: (onlyComponent?: string | string[]) => Promise<import("../../../pipeline/src/index.js").ComponentContext[]>;
|
|
15
15
|
export declare const getEnvironment: (env: string, componentName: string) => Promise<import("../../../pipeline/src/index.js").Environment>;
|
|
16
16
|
export declare const getGitlabVar: (vorpal: CommandInstance, env: string, componentName: string, variableName: string) => Promise<string>;
|
|
17
17
|
export declare const getEnvVarsResolved: (vorpal: CommandInstance | null, env: string, componentName: string | null) => Promise<Record<string, string>>;
|
|
@@ -69,9 +69,15 @@ const getAllComponentsWithAllEnvsHierarchical = async () => {
|
|
|
69
69
|
]));
|
|
70
70
|
};
|
|
71
71
|
exports.getAllComponentsWithAllEnvsHierarchical = getAllComponentsWithAllEnvsHierarchical;
|
|
72
|
-
const getAllPipelineContexts = async () => {
|
|
72
|
+
const getAllPipelineContexts = async (onlyComponent) => {
|
|
73
|
+
const onlyComponentsArray = onlyComponent
|
|
74
|
+
? Array.isArray(onlyComponent)
|
|
75
|
+
? onlyComponent
|
|
76
|
+
: [onlyComponent]
|
|
77
|
+
: null;
|
|
73
78
|
return Promise.all((await (0, exports.getAllComponentsWithAllEnvsFlat)())
|
|
74
79
|
.filter((c) => c.env !== "local")
|
|
80
|
+
.filter((c) => !onlyComponentsArray || onlyComponentsArray.includes(c.componentName))
|
|
75
81
|
.map(({ env, componentName }) => (0, exports.getPipelineContextByChoice)(env, componentName)));
|
|
76
82
|
};
|
|
77
83
|
exports.getAllPipelineContexts = getAllPipelineContexts;
|