@catladder/cli 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/catenv/index.js +41 -13
- package/dist/bundles/cli/index.js +41 -13
- package/dist/bundles/skills/catladder-config/SKILL.md +18 -7
- package/dist/bundles/skills/catladder-pipelines/SKILL.md +21 -18
- package/dist/packages/pipeline/src/config/configruedEnvs.js +7 -1
- package/dist/packages/pipeline/src/config/configruedEnvs.js.map +1 -1
- package/dist/packages/pipeline/src/context/getEnvInherit.d.ts +2 -2
- package/dist/packages/pipeline/src/context/getEnvInherit.js +5 -2
- package/dist/packages/pipeline/src/context/getEnvInherit.js.map +1 -1
- package/dist/packages/pipeline/src/context/getEnvInstance.d.ts +2 -2
- package/dist/packages/pipeline/src/context/getEnvInstance.js.map +1 -1
- package/dist/packages/pipeline/src/context/getEnvOn.d.ts +2 -2
- package/dist/packages/pipeline/src/context/getEnvOn.js +1 -1
- package/dist/packages/pipeline/src/context/getEnvOn.js.map +1 -1
- package/dist/packages/pipeline/src/context/getEnvType.d.ts +3 -3
- package/dist/packages/pipeline/src/context/getEnvType.js +1 -1
- package/dist/packages/pipeline/src/context/getEnvType.js.map +1 -1
- package/dist/packages/pipeline/src/context/getEnvironmentContext.js +3 -2
- package/dist/packages/pipeline/src/context/getEnvironmentContext.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js +3 -1
- package/dist/packages/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.d.ts +1 -1
- package/dist/packages/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.js +6 -1
- package/dist/packages/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.js.map +1 -1
- package/dist/packages/pipeline/src/pipeline/packageManager.js +6 -3
- package/dist/packages/pipeline/src/pipeline/packageManager.js.map +1 -1
- package/dist/packages/pipeline/src/types/config.d.ts +20 -2
- package/dist/packages/pipeline/src/types/config.js +9 -1
- package/dist/packages/pipeline/src/types/config.js.map +1 -1
- package/dist/skills/catladder-config/SKILL.md +18 -7
- package/dist/skills/catladder-pipelines/SKILL.md +21 -18
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -7395,6 +7395,9 @@ const getEnvType_1 = __nccwpck_require__(46080);
|
|
|
7395
7395
|
const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
7396
7396
|
var _a, _b;
|
|
7397
7397
|
const configuredEnvs = (_a = config.components[componentName].env) !== null && _a !== void 0 ? _a : {};
|
|
7398
|
+
if ((0, types_1.isEnvironmentDisabled)(config.environments, "local")) {
|
|
7399
|
+
throw new Error(`environment "local" cannot be disabled (environments.local: false) — it is only used for local development`);
|
|
7400
|
+
}
|
|
7398
7401
|
// the default envs have the same name as the env types
|
|
7399
7402
|
// these can be disabled with settimg them to `false`
|
|
7400
7403
|
// this is the list of all not disabled envs. These are always returned
|
|
@@ -7403,6 +7406,7 @@ const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
|
7403
7406
|
// component deploys to them unless it opts out with `env.<name>: false`
|
|
7404
7407
|
const declaredEnvs = Object.keys((_b = config.environments) !== null && _b !== void 0 ? _b : {})
|
|
7405
7408
|
.filter((envName) => !(0, types_1.isKnowEnvType)(envName)) // default envs are already handled above
|
|
7409
|
+
.filter((envName) => !(0, types_1.isEnvironmentDisabled)(config.environments, envName))
|
|
7406
7410
|
.map((envName) => {
|
|
7407
7411
|
const envType = (0, getEnvType_1.getDeclaredEnvType)(config.environments, envName);
|
|
7408
7412
|
if (!envType) {
|
|
@@ -7419,13 +7423,15 @@ const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
|
7419
7423
|
config.type &&
|
|
7420
7424
|
envTypes.includes(config.type))
|
|
7421
7425
|
.map(([envName]) => envName);
|
|
7426
|
+
// envs disabled project-wide (`environments.<name>: false`) exist for
|
|
7427
|
+
// no component — this wins over any per-component config of the env
|
|
7422
7428
|
return [
|
|
7423
7429
|
...new Set([
|
|
7424
7430
|
...enabledDefaultEnvs,
|
|
7425
7431
|
...declaredEnvs,
|
|
7426
7432
|
...configuredCustomEnvs,
|
|
7427
7433
|
]),
|
|
7428
|
-
];
|
|
7434
|
+
].filter((envName) => !(0, types_1.isEnvironmentDisabled)(config.environments, envName));
|
|
7429
7435
|
};
|
|
7430
7436
|
const getAllEnvs = (config, componentName) => {
|
|
7431
7437
|
return getConfiguredAndDefaultEnvs(config, componentName, types_1.DEFAULT_ENV_TYPES);
|
|
@@ -7872,6 +7878,9 @@ const assertValidInheritTarget = (environments, env, target) => {
|
|
|
7872
7878
|
if (target === "local") {
|
|
7873
7879
|
throw new Error(`environment "${env}" cannot inherit from "local" — local is not a deployment environment`);
|
|
7874
7880
|
}
|
|
7881
|
+
if ((0, config_1.isEnvironmentDisabled)(environments, target)) {
|
|
7882
|
+
throw new Error(`environment "${env}" inherits from "${target}", which is disabled (environments.${target}: false)`);
|
|
7883
|
+
}
|
|
7875
7884
|
if (!(0, config_1.isKnowEnvType)(target) && !(environments === null || environments === void 0 ? void 0 : environments[target])) {
|
|
7876
7885
|
throw new Error(`environment "${env}" inherits from unknown environment "${target}"`);
|
|
7877
7886
|
}
|
|
@@ -7887,7 +7896,7 @@ const getInheritedConfigChain = (environments, env) => {
|
|
|
7887
7896
|
const seen = new Set([env]);
|
|
7888
7897
|
let current = env;
|
|
7889
7898
|
for (;;) {
|
|
7890
|
-
const target = (0, exports.normalizeEnvInherit)((_a =
|
|
7899
|
+
const target = (0, exports.normalizeEnvInherit)((_a = (0, config_1.getEnvironmentConfig)(environments, current)) === null || _a === void 0 ? void 0 : _a.inherit).config;
|
|
7891
7900
|
if (!target)
|
|
7892
7901
|
break;
|
|
7893
7902
|
assertValidInheritTarget(environments, current, target);
|
|
@@ -7911,7 +7920,7 @@ const getSecretsEnv = (environments, env) => {
|
|
|
7911
7920
|
const seen = new Set([env]);
|
|
7912
7921
|
let current = env;
|
|
7913
7922
|
for (;;) {
|
|
7914
|
-
const target = (0, exports.normalizeEnvInherit)((_a =
|
|
7923
|
+
const target = (0, exports.normalizeEnvInherit)((_a = (0, config_1.getEnvironmentConfig)(environments, current)) === null || _a === void 0 ? void 0 : _a.inherit).secrets;
|
|
7915
7924
|
if (!target)
|
|
7916
7925
|
return current;
|
|
7917
7926
|
assertValidInheritTarget(environments, current, target);
|
|
@@ -7984,7 +7993,7 @@ const getDefaultOnForType = (envType) => {
|
|
|
7984
7993
|
*/
|
|
7985
7994
|
const getEnvOn = (env, envConfig, environments) => {
|
|
7986
7995
|
var _a;
|
|
7987
|
-
const on = (_a =
|
|
7996
|
+
const on = (_a = (0, types_1.getEnvironmentConfig)(environments, env)) === null || _a === void 0 ? void 0 : _a.on;
|
|
7988
7997
|
if (on !== undefined)
|
|
7989
7998
|
return on;
|
|
7990
7999
|
return getDefaultOnForType((0, getEnvType_1.getEnvType)(env, envConfig, environments));
|
|
@@ -8009,7 +8018,7 @@ const getEnvInherit_1 = __nccwpck_require__(52181);
|
|
|
8009
8018
|
* the type of the env they inherit their config from
|
|
8010
8019
|
*/
|
|
8011
8020
|
const getDeclaredEnvType = (environments, env, seen = new Set()) => {
|
|
8012
|
-
const declared =
|
|
8021
|
+
const declared = (0, types_1.getEnvironmentConfig)(environments, env);
|
|
8013
8022
|
if (declared === null || declared === void 0 ? void 0 : declared.type)
|
|
8014
8023
|
return declared.type;
|
|
8015
8024
|
if ((0, types_1.isKnowEnvType)(env))
|
|
@@ -8076,6 +8085,7 @@ exports.getEnvironment = getEnvironment;
|
|
|
8076
8085
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8077
8086
|
exports.getEnvironmentContext = void 0;
|
|
8078
8087
|
const bash_1 = __nccwpck_require__(94143);
|
|
8088
|
+
const config_1 = __nccwpck_require__(75591);
|
|
8079
8089
|
const getEnvConfig_1 = __nccwpck_require__(69578);
|
|
8080
8090
|
const getEnvInstance_1 = __nccwpck_require__(13055);
|
|
8081
8091
|
const getEnvInherit_1 = __nccwpck_require__(52181);
|
|
@@ -8087,7 +8097,7 @@ const getEnvironmentSlugPrefix = (env, instance) => {
|
|
|
8087
8097
|
return env;
|
|
8088
8098
|
};
|
|
8089
8099
|
const getEnvironmentContext = ({ env, componentName, config, pipelineType, }) => {
|
|
8090
|
-
var _a
|
|
8100
|
+
var _a;
|
|
8091
8101
|
const envConfigRaw = (0, getEnvConfig_1.getEnvConfig)(config, componentName, env);
|
|
8092
8102
|
const envType = (0, getEnvType_1.getEnvType)(env, envConfigRaw, config.environments);
|
|
8093
8103
|
const instance = (0, getEnvInstance_1.getEnvInstance)(envConfigRaw, env, pipelineType, config.environments);
|
|
@@ -8095,7 +8105,7 @@ const getEnvironmentContext = ({ env, componentName, config, pipelineType, }) =>
|
|
|
8095
8105
|
// config; undefined means the env type's default applies
|
|
8096
8106
|
const autoStop = envConfigRaw.autoStop !== undefined
|
|
8097
8107
|
? envConfigRaw.autoStop
|
|
8098
|
-
: (
|
|
8108
|
+
: (_a = (0, config_1.getEnvironmentConfig)(config.environments, env)) === null || _a === void 0 ? void 0 : _a.autoStop;
|
|
8099
8109
|
const environmentSlugPrefix = getEnvironmentSlugPrefix(env, instance);
|
|
8100
8110
|
const environmentSlug = environmentSlugPrefix.concat(`-${componentName}`);
|
|
8101
8111
|
const fullName = (0, bash_1.joinBashExpressions)([config.customerName, config.appName, environmentSlug], "-");
|
|
@@ -9908,7 +9918,9 @@ const getSchedulerArgs = (scheduler, context) => {
|
|
|
9908
9918
|
appFullName: context.environment.fullName,
|
|
9909
9919
|
projectId,
|
|
9910
9920
|
region,
|
|
9911
|
-
|
|
9921
|
+
// lands in a script line (not an exported variable), so the
|
|
9922
|
+
// raw expression is what the shell has to see
|
|
9923
|
+
}).toString(),
|
|
9912
9924
|
"message-body": body
|
|
9913
9925
|
? '"' + (0, bash_1.bashEscape)(JSON.stringify(body)) + '"'
|
|
9914
9926
|
: undefined,
|
|
@@ -10348,11 +10360,16 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
10348
10360
|
|
|
10349
10361
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10350
10362
|
exports.getCloudRunJobExecuteUrl = void 0;
|
|
10363
|
+
const bash_1 = __nccwpck_require__(94143);
|
|
10351
10364
|
const jobName_1 = __nccwpck_require__(65576);
|
|
10352
10365
|
function getCloudRunJobExecuteUrl(jobName, { region, projectId, appFullName, }) {
|
|
10353
10366
|
const uriBase = `https://${region}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${projectId}/jobs`;
|
|
10354
10367
|
const fullJobName = (0, jobName_1.getCloudRunJobName)(appFullName, jobName);
|
|
10355
|
-
|
|
10368
|
+
// joined, not interpolated: on review envs the job name is a bash
|
|
10369
|
+
// expression (the review slug), and a template string would demote
|
|
10370
|
+
// it to a plain string — its quotes then get escaped as literal
|
|
10371
|
+
// characters when the variable is exported
|
|
10372
|
+
return (0, bash_1.joinBashExpressions)([uriBase, "/", fullJobName, ":run"]);
|
|
10356
10373
|
}
|
|
10357
10374
|
exports.getCloudRunJobExecuteUrl = getCloudRunJobExecuteUrl;
|
|
10358
10375
|
//# sourceMappingURL=cloudRunExecutionUrl.js.map
|
|
@@ -12734,15 +12751,18 @@ const getPackageManagerInfoForComponent = async (config, componentName) => {
|
|
|
12734
12751
|
const patchFiles = baseInfo.type === "pnpm"
|
|
12735
12752
|
? (0, pnpmUtils_1.getPnpmPatchFiles)(componentIsInWorkspace ? workspaceRoot : component.dir)
|
|
12736
12753
|
: [];
|
|
12754
|
+
// sort the variable parts: their order depends on package.json key order
|
|
12755
|
+
// and dependency traversal, and an unstable order rewrites the generated
|
|
12756
|
+
// pipeline files on every regeneration without any real change
|
|
12737
12757
|
const pathsToCopyInDocker = [
|
|
12738
12758
|
...new Set([
|
|
12739
12759
|
packageJson,
|
|
12740
12760
|
...(workspacePackageJson ? [workspacePackageJson] : []),
|
|
12741
12761
|
lockFile,
|
|
12742
12762
|
...configFilePaths,
|
|
12743
|
-
...allWorkspaceManifests,
|
|
12744
|
-
...patchFiles,
|
|
12745
|
-
...currentWorkspaceDependencies,
|
|
12763
|
+
...[...allWorkspaceManifests].sort(),
|
|
12764
|
+
...[...patchFiles].sort(),
|
|
12765
|
+
...[...currentWorkspaceDependencies].sort(),
|
|
12746
12766
|
]),
|
|
12747
12767
|
];
|
|
12748
12768
|
return {
|
|
@@ -13259,7 +13279,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
13259
13279
|
"use strict";
|
|
13260
13280
|
|
|
13261
13281
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13262
|
-
exports.isKnowEnvType = exports.DEFAULT_ENV_TYPES = exports.DEFAULT_ENVS = exports.ENV_TYPES = exports.envTriggerEquals = exports.isBranchTrigger = exports.ALL_PIPELINE_TRIGGERS = void 0;
|
|
13282
|
+
exports.isEnvironmentDisabled = exports.getEnvironmentConfig = exports.isKnowEnvType = exports.DEFAULT_ENV_TYPES = exports.DEFAULT_ENVS = exports.ENV_TYPES = exports.envTriggerEquals = exports.isBranchTrigger = exports.ALL_PIPELINE_TRIGGERS = void 0;
|
|
13263
13283
|
exports.ALL_PIPELINE_TRIGGERS = [
|
|
13264
13284
|
"mainBranch",
|
|
13265
13285
|
"mr",
|
|
@@ -13302,6 +13322,14 @@ const isKnowEnvType = (env) => {
|
|
|
13302
13322
|
return env in exports.ENV_TYPES;
|
|
13303
13323
|
};
|
|
13304
13324
|
exports.isKnowEnvType = isKnowEnvType;
|
|
13325
|
+
/**
|
|
13326
|
+
* the project-wide config of `env` (undefined when not declared or
|
|
13327
|
+
* disabled)
|
|
13328
|
+
*/
|
|
13329
|
+
const getEnvironmentConfig = (environments, env) => (environments === null || environments === void 0 ? void 0 : environments[env]) || undefined;
|
|
13330
|
+
exports.getEnvironmentConfig = getEnvironmentConfig;
|
|
13331
|
+
const isEnvironmentDisabled = (environments, env) => (environments === null || environments === void 0 ? void 0 : environments[env]) === false;
|
|
13332
|
+
exports.isEnvironmentDisabled = isEnvironmentDisabled;
|
|
13305
13333
|
//# sourceMappingURL=config.js.map
|
|
13306
13334
|
|
|
13307
13335
|
/***/ }),
|
|
@@ -13972,6 +13972,9 @@ const getEnvType_1 = __nccwpck_require__(46080);
|
|
|
13972
13972
|
const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
13973
13973
|
var _a, _b;
|
|
13974
13974
|
const configuredEnvs = (_a = config.components[componentName].env) !== null && _a !== void 0 ? _a : {};
|
|
13975
|
+
if ((0, types_1.isEnvironmentDisabled)(config.environments, "local")) {
|
|
13976
|
+
throw new Error(`environment "local" cannot be disabled (environments.local: false) — it is only used for local development`);
|
|
13977
|
+
}
|
|
13975
13978
|
// the default envs have the same name as the env types
|
|
13976
13979
|
// these can be disabled with settimg them to `false`
|
|
13977
13980
|
// this is the list of all not disabled envs. These are always returned
|
|
@@ -13980,6 +13983,7 @@ const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
|
13980
13983
|
// component deploys to them unless it opts out with `env.<name>: false`
|
|
13981
13984
|
const declaredEnvs = Object.keys((_b = config.environments) !== null && _b !== void 0 ? _b : {})
|
|
13982
13985
|
.filter((envName) => !(0, types_1.isKnowEnvType)(envName)) // default envs are already handled above
|
|
13986
|
+
.filter((envName) => !(0, types_1.isEnvironmentDisabled)(config.environments, envName))
|
|
13983
13987
|
.map((envName) => {
|
|
13984
13988
|
const envType = (0, getEnvType_1.getDeclaredEnvType)(config.environments, envName);
|
|
13985
13989
|
if (!envType) {
|
|
@@ -13996,13 +14000,15 @@ const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
|
13996
14000
|
config.type &&
|
|
13997
14001
|
envTypes.includes(config.type))
|
|
13998
14002
|
.map(([envName]) => envName);
|
|
14003
|
+
// envs disabled project-wide (`environments.<name>: false`) exist for
|
|
14004
|
+
// no component — this wins over any per-component config of the env
|
|
13999
14005
|
return [
|
|
14000
14006
|
...new Set([
|
|
14001
14007
|
...enabledDefaultEnvs,
|
|
14002
14008
|
...declaredEnvs,
|
|
14003
14009
|
...configuredCustomEnvs,
|
|
14004
14010
|
]),
|
|
14005
|
-
];
|
|
14011
|
+
].filter((envName) => !(0, types_1.isEnvironmentDisabled)(config.environments, envName));
|
|
14006
14012
|
};
|
|
14007
14013
|
const getAllEnvs = (config, componentName) => {
|
|
14008
14014
|
return getConfiguredAndDefaultEnvs(config, componentName, types_1.DEFAULT_ENV_TYPES);
|
|
@@ -14449,6 +14455,9 @@ const assertValidInheritTarget = (environments, env, target) => {
|
|
|
14449
14455
|
if (target === "local") {
|
|
14450
14456
|
throw new Error(`environment "${env}" cannot inherit from "local" — local is not a deployment environment`);
|
|
14451
14457
|
}
|
|
14458
|
+
if ((0, config_1.isEnvironmentDisabled)(environments, target)) {
|
|
14459
|
+
throw new Error(`environment "${env}" inherits from "${target}", which is disabled (environments.${target}: false)`);
|
|
14460
|
+
}
|
|
14452
14461
|
if (!(0, config_1.isKnowEnvType)(target) && !(environments === null || environments === void 0 ? void 0 : environments[target])) {
|
|
14453
14462
|
throw new Error(`environment "${env}" inherits from unknown environment "${target}"`);
|
|
14454
14463
|
}
|
|
@@ -14464,7 +14473,7 @@ const getInheritedConfigChain = (environments, env) => {
|
|
|
14464
14473
|
const seen = new Set([env]);
|
|
14465
14474
|
let current = env;
|
|
14466
14475
|
for (;;) {
|
|
14467
|
-
const target = (0, exports.normalizeEnvInherit)((_a =
|
|
14476
|
+
const target = (0, exports.normalizeEnvInherit)((_a = (0, config_1.getEnvironmentConfig)(environments, current)) === null || _a === void 0 ? void 0 : _a.inherit).config;
|
|
14468
14477
|
if (!target)
|
|
14469
14478
|
break;
|
|
14470
14479
|
assertValidInheritTarget(environments, current, target);
|
|
@@ -14488,7 +14497,7 @@ const getSecretsEnv = (environments, env) => {
|
|
|
14488
14497
|
const seen = new Set([env]);
|
|
14489
14498
|
let current = env;
|
|
14490
14499
|
for (;;) {
|
|
14491
|
-
const target = (0, exports.normalizeEnvInherit)((_a =
|
|
14500
|
+
const target = (0, exports.normalizeEnvInherit)((_a = (0, config_1.getEnvironmentConfig)(environments, current)) === null || _a === void 0 ? void 0 : _a.inherit).secrets;
|
|
14492
14501
|
if (!target)
|
|
14493
14502
|
return current;
|
|
14494
14503
|
assertValidInheritTarget(environments, current, target);
|
|
@@ -14561,7 +14570,7 @@ const getDefaultOnForType = (envType) => {
|
|
|
14561
14570
|
*/
|
|
14562
14571
|
const getEnvOn = (env, envConfig, environments) => {
|
|
14563
14572
|
var _a;
|
|
14564
|
-
const on = (_a =
|
|
14573
|
+
const on = (_a = (0, types_1.getEnvironmentConfig)(environments, env)) === null || _a === void 0 ? void 0 : _a.on;
|
|
14565
14574
|
if (on !== undefined)
|
|
14566
14575
|
return on;
|
|
14567
14576
|
return getDefaultOnForType((0, getEnvType_1.getEnvType)(env, envConfig, environments));
|
|
@@ -14586,7 +14595,7 @@ const getEnvInherit_1 = __nccwpck_require__(52181);
|
|
|
14586
14595
|
* the type of the env they inherit their config from
|
|
14587
14596
|
*/
|
|
14588
14597
|
const getDeclaredEnvType = (environments, env, seen = new Set()) => {
|
|
14589
|
-
const declared =
|
|
14598
|
+
const declared = (0, types_1.getEnvironmentConfig)(environments, env);
|
|
14590
14599
|
if (declared === null || declared === void 0 ? void 0 : declared.type)
|
|
14591
14600
|
return declared.type;
|
|
14592
14601
|
if ((0, types_1.isKnowEnvType)(env))
|
|
@@ -14653,6 +14662,7 @@ exports.getEnvironment = getEnvironment;
|
|
|
14653
14662
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14654
14663
|
exports.getEnvironmentContext = void 0;
|
|
14655
14664
|
const bash_1 = __nccwpck_require__(94143);
|
|
14665
|
+
const config_1 = __nccwpck_require__(75591);
|
|
14656
14666
|
const getEnvConfig_1 = __nccwpck_require__(69578);
|
|
14657
14667
|
const getEnvInstance_1 = __nccwpck_require__(13055);
|
|
14658
14668
|
const getEnvInherit_1 = __nccwpck_require__(52181);
|
|
@@ -14664,7 +14674,7 @@ const getEnvironmentSlugPrefix = (env, instance) => {
|
|
|
14664
14674
|
return env;
|
|
14665
14675
|
};
|
|
14666
14676
|
const getEnvironmentContext = ({ env, componentName, config, pipelineType, }) => {
|
|
14667
|
-
var _a
|
|
14677
|
+
var _a;
|
|
14668
14678
|
const envConfigRaw = (0, getEnvConfig_1.getEnvConfig)(config, componentName, env);
|
|
14669
14679
|
const envType = (0, getEnvType_1.getEnvType)(env, envConfigRaw, config.environments);
|
|
14670
14680
|
const instance = (0, getEnvInstance_1.getEnvInstance)(envConfigRaw, env, pipelineType, config.environments);
|
|
@@ -14672,7 +14682,7 @@ const getEnvironmentContext = ({ env, componentName, config, pipelineType, }) =>
|
|
|
14672
14682
|
// config; undefined means the env type's default applies
|
|
14673
14683
|
const autoStop = envConfigRaw.autoStop !== undefined
|
|
14674
14684
|
? envConfigRaw.autoStop
|
|
14675
|
-
: (
|
|
14685
|
+
: (_a = (0, config_1.getEnvironmentConfig)(config.environments, env)) === null || _a === void 0 ? void 0 : _a.autoStop;
|
|
14676
14686
|
const environmentSlugPrefix = getEnvironmentSlugPrefix(env, instance);
|
|
14677
14687
|
const environmentSlug = environmentSlugPrefix.concat(`-${componentName}`);
|
|
14678
14688
|
const fullName = (0, bash_1.joinBashExpressions)([config.customerName, config.appName, environmentSlug], "-");
|
|
@@ -16485,7 +16495,9 @@ const getSchedulerArgs = (scheduler, context) => {
|
|
|
16485
16495
|
appFullName: context.environment.fullName,
|
|
16486
16496
|
projectId,
|
|
16487
16497
|
region,
|
|
16488
|
-
|
|
16498
|
+
// lands in a script line (not an exported variable), so the
|
|
16499
|
+
// raw expression is what the shell has to see
|
|
16500
|
+
}).toString(),
|
|
16489
16501
|
"message-body": body
|
|
16490
16502
|
? '"' + (0, bash_1.bashEscape)(JSON.stringify(body)) + '"'
|
|
16491
16503
|
: undefined,
|
|
@@ -16925,11 +16937,16 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
16925
16937
|
|
|
16926
16938
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
16927
16939
|
exports.getCloudRunJobExecuteUrl = void 0;
|
|
16940
|
+
const bash_1 = __nccwpck_require__(94143);
|
|
16928
16941
|
const jobName_1 = __nccwpck_require__(65576);
|
|
16929
16942
|
function getCloudRunJobExecuteUrl(jobName, { region, projectId, appFullName, }) {
|
|
16930
16943
|
const uriBase = `https://${region}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${projectId}/jobs`;
|
|
16931
16944
|
const fullJobName = (0, jobName_1.getCloudRunJobName)(appFullName, jobName);
|
|
16932
|
-
|
|
16945
|
+
// joined, not interpolated: on review envs the job name is a bash
|
|
16946
|
+
// expression (the review slug), and a template string would demote
|
|
16947
|
+
// it to a plain string — its quotes then get escaped as literal
|
|
16948
|
+
// characters when the variable is exported
|
|
16949
|
+
return (0, bash_1.joinBashExpressions)([uriBase, "/", fullJobName, ":run"]);
|
|
16933
16950
|
}
|
|
16934
16951
|
exports.getCloudRunJobExecuteUrl = getCloudRunJobExecuteUrl;
|
|
16935
16952
|
//# sourceMappingURL=cloudRunExecutionUrl.js.map
|
|
@@ -19311,15 +19328,18 @@ const getPackageManagerInfoForComponent = async (config, componentName) => {
|
|
|
19311
19328
|
const patchFiles = baseInfo.type === "pnpm"
|
|
19312
19329
|
? (0, pnpmUtils_1.getPnpmPatchFiles)(componentIsInWorkspace ? workspaceRoot : component.dir)
|
|
19313
19330
|
: [];
|
|
19331
|
+
// sort the variable parts: their order depends on package.json key order
|
|
19332
|
+
// and dependency traversal, and an unstable order rewrites the generated
|
|
19333
|
+
// pipeline files on every regeneration without any real change
|
|
19314
19334
|
const pathsToCopyInDocker = [
|
|
19315
19335
|
...new Set([
|
|
19316
19336
|
packageJson,
|
|
19317
19337
|
...(workspacePackageJson ? [workspacePackageJson] : []),
|
|
19318
19338
|
lockFile,
|
|
19319
19339
|
...configFilePaths,
|
|
19320
|
-
...allWorkspaceManifests,
|
|
19321
|
-
...patchFiles,
|
|
19322
|
-
...currentWorkspaceDependencies,
|
|
19340
|
+
...[...allWorkspaceManifests].sort(),
|
|
19341
|
+
...[...patchFiles].sort(),
|
|
19342
|
+
...[...currentWorkspaceDependencies].sort(),
|
|
19323
19343
|
]),
|
|
19324
19344
|
];
|
|
19325
19345
|
return {
|
|
@@ -19836,7 +19856,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
19836
19856
|
"use strict";
|
|
19837
19857
|
|
|
19838
19858
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
19839
|
-
exports.isKnowEnvType = exports.DEFAULT_ENV_TYPES = exports.DEFAULT_ENVS = exports.ENV_TYPES = exports.envTriggerEquals = exports.isBranchTrigger = exports.ALL_PIPELINE_TRIGGERS = void 0;
|
|
19859
|
+
exports.isEnvironmentDisabled = exports.getEnvironmentConfig = exports.isKnowEnvType = exports.DEFAULT_ENV_TYPES = exports.DEFAULT_ENVS = exports.ENV_TYPES = exports.envTriggerEquals = exports.isBranchTrigger = exports.ALL_PIPELINE_TRIGGERS = void 0;
|
|
19840
19860
|
exports.ALL_PIPELINE_TRIGGERS = [
|
|
19841
19861
|
"mainBranch",
|
|
19842
19862
|
"mr",
|
|
@@ -19879,6 +19899,14 @@ const isKnowEnvType = (env) => {
|
|
|
19879
19899
|
return env in exports.ENV_TYPES;
|
|
19880
19900
|
};
|
|
19881
19901
|
exports.isKnowEnvType = isKnowEnvType;
|
|
19902
|
+
/**
|
|
19903
|
+
* the project-wide config of `env` (undefined when not declared or
|
|
19904
|
+
* disabled)
|
|
19905
|
+
*/
|
|
19906
|
+
const getEnvironmentConfig = (environments, env) => (environments === null || environments === void 0 ? void 0 : environments[env]) || undefined;
|
|
19907
|
+
exports.getEnvironmentConfig = getEnvironmentConfig;
|
|
19908
|
+
const isEnvironmentDisabled = (environments, env) => (environments === null || environments === void 0 ? void 0 : environments[env]) === false;
|
|
19909
|
+
exports.isEnvironmentDisabled = isEnvironmentDisabled;
|
|
19882
19910
|
//# sourceMappingURL=config.js.map
|
|
19883
19911
|
|
|
19884
19912
|
/***/ }),
|
|
@@ -33,20 +33,23 @@ const config = {
|
|
|
33
33
|
appName: "my-app",
|
|
34
34
|
customerName: "pan",
|
|
35
35
|
pipelines: { gitlab: true, github: true }, // which CI systems to generate
|
|
36
|
-
environments: {
|
|
36
|
+
environments: {
|
|
37
|
+
// optional: project-wide env declarations/tuning
|
|
37
38
|
review: { autoStop: "3 days" },
|
|
39
|
+
stage: false, // the project has no stage env (any component)
|
|
38
40
|
next: { type: "dev", on: { branch: "next" } }, // extra branch-tracking env
|
|
39
41
|
},
|
|
40
42
|
components: {
|
|
41
43
|
www: {
|
|
42
|
-
dir: "frontend",
|
|
43
|
-
vars: { public: {}, secret: [] },
|
|
44
|
-
build: { type: "node" },
|
|
44
|
+
dir: "frontend", // working directory of this component
|
|
45
|
+
vars: { public: {}, secret: [] }, // env vars (see catladder-secrets skill)
|
|
46
|
+
build: { type: "node" }, // node | rails | meteor | custom — see catladder-builds
|
|
45
47
|
deploy: { type: "kubernetes" }, // kubernetes | google-cloudrun | dockerTag | custom — see catladder-deploys
|
|
46
|
-
env: {
|
|
48
|
+
env: {
|
|
49
|
+
// enable/customize per environment
|
|
47
50
|
review: {},
|
|
48
51
|
dev: {},
|
|
49
|
-
stage: false,
|
|
52
|
+
stage: false, // false disables the env for this component only
|
|
50
53
|
prod: {},
|
|
51
54
|
},
|
|
52
55
|
},
|
|
@@ -68,9 +71,17 @@ Key concepts:
|
|
|
68
71
|
per-component `env.<name>` entries only carry component-local
|
|
69
72
|
overrides (vars, deploy settings, host, autoStop) or `false` to opt
|
|
70
73
|
the component out. In `environments`:
|
|
74
|
+
- `<name>: false` — disables the env for the whole project: no
|
|
75
|
+
component has it, so no setup contexts (`catladder project setup`),
|
|
76
|
+
secrets, pipeline jobs/workflows or catenv for it. This is how to
|
|
77
|
+
say "this project has no stage": `environments: { stage: false }`
|
|
78
|
+
(not `on: false`). `local` cannot be disabled; inheriting from a
|
|
79
|
+
disabled env is an error.
|
|
71
80
|
- `on` — when the env deploys: `"mainBranch"`, `"mr"`,
|
|
72
81
|
`"taggedRelease"`, `{ branch: "next" }` (a stable env deploying on
|
|
73
|
-
pushes to that branch), or `false` (
|
|
82
|
+
pushes to that branch), or `false` (never deployed by a pipeline —
|
|
83
|
+
the env still exists for setup, secrets and catenv; use
|
|
84
|
+
`environments.<name>: false` to remove it). `on: "mr"`
|
|
74
85
|
makes an env a review app (one instance per MR/PR, torn down on
|
|
75
86
|
close). Defaults from the env type.
|
|
76
87
|
- `autoStop` — how long a stoppable environment stays up after its
|
|
@@ -11,12 +11,12 @@ generated YAML.
|
|
|
11
11
|
|
|
12
12
|
## Triggers and environments
|
|
13
13
|
|
|
14
|
-
| Trigger
|
|
15
|
-
|
|
16
|
-
| `mainBranch`
|
|
17
|
-
| `mr`
|
|
18
|
-
| `taggedRelease`
|
|
19
|
-
| `{ branch: "<name>" }` | push to that branch
|
|
14
|
+
| Trigger | Runs on | Deploys to (default) |
|
|
15
|
+
| ---------------------- | ----------------------- | ---------------------------- |
|
|
16
|
+
| `mainBranch` | push to the main branch | `dev` |
|
|
17
|
+
| `mr` | merge/pull requests | `review` (one app per MR/PR) |
|
|
18
|
+
| `taggedRelease` | git tags | `stage`, `prod` |
|
|
19
|
+
| `{ branch: "<name>" }` | push to that branch | envs declaring it via `on` |
|
|
20
20
|
|
|
21
21
|
The trigger of each env is its `on` in the top-level `environments`
|
|
22
22
|
config (project-wide — components cannot diverge), defaulting from the
|
|
@@ -25,6 +25,9 @@ own pipeline (gitlab: rules on `$CI_COMMIT_BRANCH`; github: a
|
|
|
25
25
|
`catladder-branch-<name>.yml` workflow) and deploys as one stable,
|
|
26
26
|
branch-tracking environment — unlike review apps, it is not
|
|
27
27
|
per-instance and is stopped via the manual stop job/workflow.
|
|
28
|
+
`on: false` keeps an env out of every pipeline but the env still exists
|
|
29
|
+
(setup, secrets, catenv); `environments: { <name>: false }` removes it
|
|
30
|
+
entirely.
|
|
28
31
|
|
|
29
32
|
Generated layout:
|
|
30
33
|
|
|
@@ -34,12 +37,12 @@ Generated layout:
|
|
|
34
37
|
"generated by catladder" header; others are unmanaged). Manual
|
|
35
38
|
actions are per-kind `workflow_dispatch` workflows, visually grouped
|
|
36
39
|
by their emoji prefix in the Actions sidebar: `🚀 catladder create
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
release`, `▶️ catladder deploy` (manual-gated deploys), `🛑 catladder
|
|
41
|
+
stop`, `↩️ catladder rollback` — when all of a kind's tasks target one
|
|
39
42
|
env the name carries it (e.g. `▶️ catladder deploy prod`); otherwise
|
|
40
43
|
pick the task from the workflow's dropdown. Review apps are stopped
|
|
41
44
|
automatically when their pull request closes (`🛑 catladder stop
|
|
42
|
-
|
|
45
|
+
review app`); the same workflow can be dispatched with a PR number to
|
|
43
46
|
tear one down while the pull request is still open (gitlab runs these as manual jobs inside the pipeline
|
|
44
47
|
instead).
|
|
45
48
|
|
|
@@ -51,22 +54,22 @@ plus stop jobs for review-app teardown.
|
|
|
51
54
|
Pushing a new commit cancels the pipeline of the previous one, so the
|
|
52
55
|
runners are not busy with results nobody will read.
|
|
53
56
|
|
|
54
|
-
| Pipeline
|
|
55
|
-
|
|
56
|
-
| `mr`
|
|
57
|
-
| `mainBranch` (dev)
|
|
58
|
-
| `taggedRelease`
|
|
59
|
-
| agent runs (`trigger`) | **runs through** — never cancelled
|
|
57
|
+
| Pipeline | On a new commit |
|
|
58
|
+
| ---------------------- | ------------------------------------------- |
|
|
59
|
+
| `mr` | cancelled |
|
|
60
|
+
| `mainBranch` (dev) | cancelled, except a release already running |
|
|
61
|
+
| `taggedRelease` | **runs through** — never cancelled |
|
|
62
|
+
| agent runs (`trigger`) | **runs through** — never cancelled |
|
|
60
63
|
|
|
61
64
|
- **GitHub**: the generated MR workflow sets `concurrency` with
|
|
62
65
|
`cancel-in-progress: true`.
|
|
63
66
|
- **GitLab**: generated `workflow:auto_cancel:on_new_commit:
|
|
64
|
-
|
|
67
|
+
interruptible`, with per-rule `none` for tags and agent runs. Every
|
|
65
68
|
job carries an explicit `interruptible`, jobs that must finish
|
|
66
69
|
(release jobs, agent jobs) carry `interruptible: false`.
|
|
67
70
|
|
|
68
71
|
**GitLab requires the project setting too.** The generated YAML only
|
|
69
|
-
tunes
|
|
72
|
+
tunes _how_ redundant pipelines are cancelled — it does not switch the
|
|
70
73
|
feature on. If old pipelines keep running, check **Settings > CI/CD >
|
|
71
74
|
General pipelines > Auto-cancel redundant pipelines**; with that
|
|
72
75
|
checkbox off nothing is ever cancelled. (`catladder project-doctor`
|
|
@@ -74,7 +77,7 @@ does not check this.)
|
|
|
74
77
|
|
|
75
78
|
**Adding a hand-written GitLab job?** Set `interruptible` explicitly.
|
|
76
79
|
GitLab defaults it to `false`, and a non-interruptible job that has
|
|
77
|
-
started keeps
|
|
80
|
+
started keeps _itself_ alive — under gitlab's own default
|
|
78
81
|
(`conservative`, which catladder overrides) it would shield the whole
|
|
79
82
|
pipeline from cancellation.
|
|
80
83
|
|
|
@@ -7,6 +7,9 @@ const getEnvType_1 = require("../context/getEnvType");
|
|
|
7
7
|
const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
8
8
|
var _a, _b;
|
|
9
9
|
const configuredEnvs = (_a = config.components[componentName].env) !== null && _a !== void 0 ? _a : {};
|
|
10
|
+
if ((0, types_1.isEnvironmentDisabled)(config.environments, "local")) {
|
|
11
|
+
throw new Error(`environment "local" cannot be disabled (environments.local: false) — it is only used for local development`);
|
|
12
|
+
}
|
|
10
13
|
// the default envs have the same name as the env types
|
|
11
14
|
// these can be disabled with settimg them to `false`
|
|
12
15
|
// this is the list of all not disabled envs. These are always returned
|
|
@@ -15,6 +18,7 @@ const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
|
15
18
|
// component deploys to them unless it opts out with `env.<name>: false`
|
|
16
19
|
const declaredEnvs = Object.keys((_b = config.environments) !== null && _b !== void 0 ? _b : {})
|
|
17
20
|
.filter((envName) => !(0, types_1.isKnowEnvType)(envName)) // default envs are already handled above
|
|
21
|
+
.filter((envName) => !(0, types_1.isEnvironmentDisabled)(config.environments, envName))
|
|
18
22
|
.map((envName) => {
|
|
19
23
|
const envType = (0, getEnvType_1.getDeclaredEnvType)(config.environments, envName);
|
|
20
24
|
if (!envType) {
|
|
@@ -31,13 +35,15 @@ const getConfiguredAndDefaultEnvs = (config, componentName, envTypes) => {
|
|
|
31
35
|
config.type &&
|
|
32
36
|
envTypes.includes(config.type))
|
|
33
37
|
.map(([envName]) => envName);
|
|
38
|
+
// envs disabled project-wide (`environments.<name>: false`) exist for
|
|
39
|
+
// no component — this wins over any per-component config of the env
|
|
34
40
|
return [
|
|
35
41
|
...new Set([
|
|
36
42
|
...enabledDefaultEnvs,
|
|
37
43
|
...declaredEnvs,
|
|
38
44
|
...configuredCustomEnvs,
|
|
39
45
|
]),
|
|
40
|
-
];
|
|
46
|
+
].filter((envName) => !(0, types_1.isEnvironmentDisabled)(config.environments, envName));
|
|
41
47
|
};
|
|
42
48
|
const getAllEnvs = (config, componentName) => {
|
|
43
49
|
return getConfiguredAndDefaultEnvs(config, componentName, types_1.DEFAULT_ENV_TYPES);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configruedEnvs.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/config/configruedEnvs.ts"],"names":[],"mappings":";;;AAMA,
|
|
1
|
+
{"version":3,"file":"configruedEnvs.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/config/configruedEnvs.ts"],"names":[],"mappings":";;;AAMA,oCAMkB;AAClB,kDAA+C;AAC/C,sDAA2D;AAE3D,MAAM,2BAA2B,GAAG,CAClC,MAAc,EACd,aAAqB,EACrB,QAAmB,EACnB,EAAE;;IACF,MAAM,cAAc,GAAG,MAAA,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,GAAG,mCAAI,EAAE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bW,QAAA,2BAA2B,+BAatC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EnvironmentConfig } from "../types/config";
|
|
2
|
-
type Environments =
|
|
1
|
+
import type { EnvironmentConfig, EnvironmentsConfig } from "../types/config";
|
|
2
|
+
type Environments = EnvironmentsConfig | undefined;
|
|
3
3
|
export type NormalizedEnvInherit = {
|
|
4
4
|
config?: string;
|
|
5
5
|
secrets?: string;
|
|
@@ -18,6 +18,9 @@ const assertValidInheritTarget = (environments, env, target) => {
|
|
|
18
18
|
if (target === "local") {
|
|
19
19
|
throw new Error(`environment "${env}" cannot inherit from "local" — local is not a deployment environment`);
|
|
20
20
|
}
|
|
21
|
+
if ((0, config_1.isEnvironmentDisabled)(environments, target)) {
|
|
22
|
+
throw new Error(`environment "${env}" inherits from "${target}", which is disabled (environments.${target}: false)`);
|
|
23
|
+
}
|
|
21
24
|
if (!(0, config_1.isKnowEnvType)(target) && !(environments === null || environments === void 0 ? void 0 : environments[target])) {
|
|
22
25
|
throw new Error(`environment "${env}" inherits from unknown environment "${target}"`);
|
|
23
26
|
}
|
|
@@ -33,7 +36,7 @@ const getInheritedConfigChain = (environments, env) => {
|
|
|
33
36
|
const seen = new Set([env]);
|
|
34
37
|
let current = env;
|
|
35
38
|
for (;;) {
|
|
36
|
-
const target = (0, exports.normalizeEnvInherit)((_a =
|
|
39
|
+
const target = (0, exports.normalizeEnvInherit)((_a = (0, config_1.getEnvironmentConfig)(environments, current)) === null || _a === void 0 ? void 0 : _a.inherit).config;
|
|
37
40
|
if (!target)
|
|
38
41
|
break;
|
|
39
42
|
assertValidInheritTarget(environments, current, target);
|
|
@@ -57,7 +60,7 @@ const getSecretsEnv = (environments, env) => {
|
|
|
57
60
|
const seen = new Set([env]);
|
|
58
61
|
let current = env;
|
|
59
62
|
for (;;) {
|
|
60
|
-
const target = (0, exports.normalizeEnvInherit)((_a =
|
|
63
|
+
const target = (0, exports.normalizeEnvInherit)((_a = (0, config_1.getEnvironmentConfig)(environments, current)) === null || _a === void 0 ? void 0 : _a.inherit).secrets;
|
|
61
64
|
if (!target)
|
|
62
65
|
return current;
|
|
63
66
|
assertValidInheritTarget(environments, current, target);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEnvInherit.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvInherit.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"getEnvInherit.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvInherit.ts"],"names":[],"mappings":";;;AACA,4CAIyB;AASlB,MAAM,mBAAmB,GAAG,CACjC,OAAqC,EACf,EAAE;IACxB,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC/C,CAAC;IACD,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO;KACjE,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,mBAAmB,uBAW9B;AAEF,MAAM,wBAAwB,GAAG,CAC/B,YAA0B,EAC1B,GAAW,EACX,MAAc,EACd,EAAE;IACF,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,gBAAgB,GAAG,uEAAuE,CAC3F,CAAC;IACJ,CAAC;IACD,IAAI,IAAA,8BAAqB,EAAC,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,gBAAgB,GAAG,oBAAoB,MAAM,sCAAsC,MAAM,UAAU,CACpG,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,IAAA,sBAAa,EAAC,MAAM,CAAC,IAAI,C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AM,GAAG,IAAA,2BAAmB,EAChC,MAAA,IAAA,6BAAoB,EAAC,YAAY,EAAE,OAAO,CAAC,0CAAE,OAAO,CACrD,CAAC,OAAO,CAAC;QACV,IAAI,CAAC,MAAM;YAAE,OAAO,OAAO,CAAC;QAC5B,wBAAwB,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,gBAAgB,GAAG,2CAA2C,MAAM,GAAG,CACxE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AApBW,QAAA,aAAa,iBAoBxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PipelineType } from "../types";
|
|
2
|
-
import type { EnvConfigWithComponent,
|
|
2
|
+
import type { EnvConfigWithComponent, EnvironmentsConfig } from "../types/config";
|
|
3
3
|
import type { EnvironmentInstance } from "../types/environmentContext";
|
|
4
|
-
export declare const getEnvInstance: (envConfig: EnvConfigWithComponent, env: string, pipelineType?: PipelineType, environments?:
|
|
4
|
+
export declare const getEnvInstance: (envConfig: EnvConfigWithComponent, env: string, pipelineType?: PipelineType, environments?: EnvironmentsConfig) => EnvironmentInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEnvInstance.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvInstance.ts"],"names":[],"mappings":";;;AAAA,0CAAiD;AAEjD,yFAAyF;AAOzF,yCAAsC;AACtC,MAAM,WAAW,GAAkC;IACjD,OAAO,EAAE,qBAAqB;IAC9B,MAAM,EAAE,IAAI,qBAAc,CACxB,0JAA0J,CAC3J;IACD,uEAAuE;IACvE,MAAM,EAAE,IAAI,qBAAc,CACxB,uEAAuE,CACxE;CACF,CAAC;AAEK,MAAM,cAAc,GAAG,CAC5B,SAAiC,EACjC,GAAW,EACX,YAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"getEnvInstance.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvInstance.ts"],"names":[],"mappings":";;;AAAA,0CAAiD;AAEjD,yFAAyF;AAOzF,yCAAsC;AACtC,MAAM,WAAW,GAAkC;IACjD,OAAO,EAAE,qBAAqB;IAC9B,MAAM,EAAE,IAAI,qBAAc,CACxB,0JAA0J,CAC3J;IACD,uEAAuE;IACvE,MAAM,EAAE,IAAI,qBAAc,CACxB,uEAAuE,CACxE;CACF,CAAC;AAEK,MAAM,cAAc,GAAG,CAC5B,SAAiC,EACjC,GAAW,EACX,YAA2B,EAC3B,YAAiC,EACZ,EAAE;IACvB,mEAAmE;IACnE,iDAAiD;IACjD,IAAI,IAAA,mBAAQ,EAAC,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC;QACpD,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,IAAA,gEAAgC,EAAC,WAAW,EAAE,YAAY,CAAC;SACxE,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC5B,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EnvironmentsConfig, EnvOnConfig, EnvType } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* resolves when an env deploys: the project-wide `on` config of the env
|
|
4
4
|
* (top-level `environments`), falling back to the default of its env
|
|
@@ -10,4 +10,4 @@ import type { EnvironmentConfig, EnvOnConfig, EnvType } from "../types";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const getEnvOn: (env: string, envConfig: {
|
|
12
12
|
type?: EnvType;
|
|
13
|
-
}, environments?:
|
|
13
|
+
}, environments?: EnvironmentsConfig) => EnvOnConfig;
|
|
@@ -19,7 +19,7 @@ const getDefaultOnForType = (envType) => {
|
|
|
19
19
|
*/
|
|
20
20
|
const getEnvOn = (env, envConfig, environments) => {
|
|
21
21
|
var _a;
|
|
22
|
-
const on = (_a =
|
|
22
|
+
const on = (_a = (0, types_1.getEnvironmentConfig)(environments, env)) === null || _a === void 0 ? void 0 : _a.on;
|
|
23
23
|
if (on !== undefined)
|
|
24
24
|
return on;
|
|
25
25
|
return getDefaultOnForType((0, getEnvType_1.getEnvType)(env, envConfig, environments));
|