@catladder/cli 5.4.1 → 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 +26 -8
- package/dist/bundles/cli/index.js +26 -8
- 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/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], "-");
|
|
@@ -13269,7 +13279,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
13269
13279
|
"use strict";
|
|
13270
13280
|
|
|
13271
13281
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13272
|
-
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;
|
|
13273
13283
|
exports.ALL_PIPELINE_TRIGGERS = [
|
|
13274
13284
|
"mainBranch",
|
|
13275
13285
|
"mr",
|
|
@@ -13312,6 +13322,14 @@ const isKnowEnvType = (env) => {
|
|
|
13312
13322
|
return env in exports.ENV_TYPES;
|
|
13313
13323
|
};
|
|
13314
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;
|
|
13315
13333
|
//# sourceMappingURL=config.js.map
|
|
13316
13334
|
|
|
13317
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], "-");
|
|
@@ -19846,7 +19856,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
19846
19856
|
"use strict";
|
|
19847
19857
|
|
|
19848
19858
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
19849
|
-
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;
|
|
19850
19860
|
exports.ALL_PIPELINE_TRIGGERS = [
|
|
19851
19861
|
"mainBranch",
|
|
19852
19862
|
"mr",
|
|
@@ -19889,6 +19899,14 @@ const isKnowEnvType = (env) => {
|
|
|
19889
19899
|
return env in exports.ENV_TYPES;
|
|
19890
19900
|
};
|
|
19891
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;
|
|
19892
19910
|
//# sourceMappingURL=config.js.map
|
|
19893
19911
|
|
|
19894
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,CAAC;IAClE,IAAI,IAAA,6BAAqB,EAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CACb,4GAA4G,CAC7G,CAAC;IACJ,CAAC;IACD,uDAAuD;IACvD,qDAAqD;IACrD,uEAAuE;IACvE,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CACxC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,KAAK,CACnC,CAAC;IAEF,+DAA+D;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C,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CACtD,IAAA,wBAAgB,EACd,uBAAuB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,EACnD,OAAO,CACR,CACF,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,mBAAmB,uBAW9B;AAEF;;;;;GAKG;AACI,MAAM,2BAA2B,GAAG,CACzC,MAAc,EACW,EAAE;IAC3B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3D,KAAK,MAAM,GAAG,IAAI,IAAA,kBAAU,EAAC,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC;YACpD,MAAM,EAAE,GAAG,uBAAuB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;YAC/D,IAAI,EAAE,IAAI,IAAA,uBAAe,EAAC,EAAE,CAAC,EAAE,CAAC;gBAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC,CAAC;AAbW,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"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2C,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));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEnvOn.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvOn.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"getEnvOn.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvOn.ts"],"names":[],"mappings":";;;AACA,oCAA2D;AAC3D,6CAA0C;AAE1C,MAAM,mBAAmB,GAAG,CAAC,OAAgB,EAAe,EAAE;;IAC5D,MAAM,QAAQ,GAAG,iBAAS,CAAC,OAAO,CAAC,CAAC,QAAkC,CAAC;IACvE,OAAO,MAAA,QAAQ,CAAC,CAAC,CAAC,mCAAI,KAAK,CAAC;AAC9B,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACI,MAAM,QAAQ,GAAG,CACtB,GAAW,EACX,SAEC,EACD,YAAiC,EACpB,EAAE;;IACf,MAAM,EAAE,GAAG,MAAA,IAAA,4BAAoB,EAAC,YAAY,EAAE,GAAG,CAAC,0CAAE,EAAE,CAAC;IACvD,IAAI,EAAE,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,mBAAmB,CAAC,IAAA,uBAAU,EAAC,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AACvE,CAAC,CAAC;AAVW,QAAA,QAAQ,YAUnB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EnvironmentsConfig, EnvType } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* the type of a project-wide declared env: its explicit `type`, its
|
|
4
4
|
* name (when it is itself an env type), or — for envs that inherit —
|
|
5
5
|
* the type of the env they inherit their config from
|
|
6
6
|
*/
|
|
7
|
-
export declare const getDeclaredEnvType: (environments:
|
|
7
|
+
export declare const getDeclaredEnvType: (environments: EnvironmentsConfig | undefined, env: string, seen?: Set<string>) => EnvType | undefined;
|
|
8
8
|
export declare const getEnvType: (env: string, envConfig: {
|
|
9
9
|
type?: EnvType;
|
|
10
|
-
}, environments?:
|
|
10
|
+
}, environments?: EnvironmentsConfig) => EnvType;
|
|
@@ -9,7 +9,7 @@ const getEnvInherit_1 = require("./getEnvInherit");
|
|
|
9
9
|
* the type of the env they inherit their config from
|
|
10
10
|
*/
|
|
11
11
|
const getDeclaredEnvType = (environments, env, seen = new Set()) => {
|
|
12
|
-
const declared =
|
|
12
|
+
const declared = (0, types_1.getEnvironmentConfig)(environments, env);
|
|
13
13
|
if (declared === null || declared === void 0 ? void 0 : declared.type)
|
|
14
14
|
return declared.type;
|
|
15
15
|
if ((0, types_1.isKnowEnvType)(env))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEnvType.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvType.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"getEnvType.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvType.ts"],"names":[],"mappings":";;;AACA,oCAA+D;AAC/D,mDAAsD;AAEtD;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAChC,YAA4C,EAC5C,GAAW,EACX,OAAoB,IAAI,GAAG,EAAE,EACR,EAAE;IACvB,MAAM,QAAQ,GAAG,IAAA,4BAAoB,EAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACzD,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI;QAAE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzC,IAAI,IAAA,qBAAa,EAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAEnC,MAAM,aAAa,GAAG,IAAA,mCAAmB,EAAC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,CAAC,CAAC,MAAM,CAAC;IACpE,IAAI,aAAa,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9C,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACxB,OAAO,IAAA,0BAAkB,EAAC,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAfW,QAAA,kBAAkB,sBAe7B;AAEK,MAAM,UAAU,GAAG,CACxB,GAAW,EACX,SAEC,EACD,YAAiC,EACxB,EAAE;IACX,kEAAkE;IAClE,IAAI,SAAS,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC;IAE1C,sDAAsD;IACtD,MAAM,YAAY,GAAG,IAAA,0BAAkB,EAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IAC3D,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IAEtC,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,GAAG,CAAC,CAAC;AAC9C,CAAC,CAAC;AAfW,QAAA,UAAU,cAerB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getEnvironmentContext = void 0;
|
|
4
4
|
const bash_1 = require("../../../bash/src/index.js");
|
|
5
|
+
const config_1 = require("../types/config");
|
|
5
6
|
const getEnvConfig_1 = require("./getEnvConfig");
|
|
6
7
|
const getEnvInstance_1 = require("./getEnvInstance");
|
|
7
8
|
const getEnvInherit_1 = require("./getEnvInherit");
|
|
@@ -13,7 +14,7 @@ const getEnvironmentSlugPrefix = (env, instance) => {
|
|
|
13
14
|
return env;
|
|
14
15
|
};
|
|
15
16
|
const getEnvironmentContext = ({ env, componentName, config, pipelineType, }) => {
|
|
16
|
-
var _a
|
|
17
|
+
var _a;
|
|
17
18
|
const envConfigRaw = (0, getEnvConfig_1.getEnvConfig)(config, componentName, env);
|
|
18
19
|
const envType = (0, getEnvType_1.getEnvType)(env, envConfigRaw, config.environments);
|
|
19
20
|
const instance = (0, getEnvInstance_1.getEnvInstance)(envConfigRaw, env, pipelineType, config.environments);
|
|
@@ -21,7 +22,7 @@ const getEnvironmentContext = ({ env, componentName, config, pipelineType, }) =>
|
|
|
21
22
|
// config; undefined means the env type's default applies
|
|
22
23
|
const autoStop = envConfigRaw.autoStop !== undefined
|
|
23
24
|
? envConfigRaw.autoStop
|
|
24
|
-
: (
|
|
25
|
+
: (_a = (0, config_1.getEnvironmentConfig)(config.environments, env)) === null || _a === void 0 ? void 0 : _a.autoStop;
|
|
25
26
|
const environmentSlugPrefix = getEnvironmentSlugPrefix(env, instance);
|
|
26
27
|
const environmentSlug = environmentSlugPrefix.concat(`-${componentName}`);
|
|
27
28
|
const fullName = (0, bash_1.joinBashExpressions)([config.customerName, config.appName, environmentSlug], "-");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEnvironmentContext.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvironmentContext.ts"],"names":[],"mappings":";;;AAEA,0CAAsD;AAMtD,iDAA8C;AAC9C,qDAAkD;AAClD,mDAAgD;AAChD,6CAA0C;AAE1C,MAAM,wBAAwB,GAAG,CAC/B,GAAW,EACX,QAA6B,EACL,EAAE;IAC1B,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,IAAA,0BAAmB,EAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEK,MAAM,qBAAqB,GAAG,CAAC,EACpC,GAAG,EACH,aAAa,EACb,MAAM,EACN,YAAY,GACkB,EAAsB,EAAE;;IACtD,MAAM,YAAY,GAAG,IAAA,2BAAY,EAAC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,IAAA,uBAAU,EAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,IAAA,+BAAc,EAC7B,YAAY,EACZ,GAAG,EACH,YAAY,EACZ,MAAM,CAAC,YAAY,CACpB,CAAC;IAEF,kEAAkE;IAClE,yDAAyD;IACzD,MAAM,QAAQ,GACZ,YAAY,CAAC,QAAQ,KAAK,SAAS;QACjC,CAAC,CAAC,YAAY,CAAC,QAAQ;QACvB,CAAC,CAAC,MAAA,
|
|
1
|
+
{"version":3,"file":"getEnvironmentContext.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvironmentContext.ts"],"names":[],"mappings":";;;AAEA,0CAAsD;AAMtD,4CAAuD;AACvD,iDAA8C;AAC9C,qDAAkD;AAClD,mDAAgD;AAChD,6CAA0C;AAE1C,MAAM,wBAAwB,GAAG,CAC/B,GAAW,EACX,QAA6B,EACL,EAAE;IAC1B,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,IAAA,0BAAmB,EAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEK,MAAM,qBAAqB,GAAG,CAAC,EACpC,GAAG,EACH,aAAa,EACb,MAAM,EACN,YAAY,GACkB,EAAsB,EAAE;;IACtD,MAAM,YAAY,GAAG,IAAA,2BAAY,EAAC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,IAAA,uBAAU,EAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,IAAA,+BAAc,EAC7B,YAAY,EACZ,GAAG,EACH,YAAY,EACZ,MAAM,CAAC,YAAY,CACpB,CAAC;IAEF,kEAAkE;IAClE,yDAAyD;IACzD,MAAM,QAAQ,GACZ,YAAY,CAAC,QAAQ,KAAK,SAAS;QACjC,CAAC,CAAC,YAAY,CAAC,QAAQ;QACvB,CAAC,CAAC,MAAA,IAAA,6BAAoB,EAAC,MAAM,CAAC,YAA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