@catladder/cli 0.0.0-next-51c86d8a → 0.0.0-next-9a3feef4
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 +54 -131
- package/dist/bundles/cli/index.js +54 -131
- package/dist/pipeline/src/build/base/createAppBuildJob.js +2 -3
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/custom/testJob.js +10 -11
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- package/dist/pipeline/src/build/node/cache.js +1 -0
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.js +10 -11
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.js +0 -1
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/test.js +7 -8
- package/dist/pipeline/src/build/rails/test.js.map +1 -1
- package/dist/pipeline/src/build/types.d.ts +0 -10
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/context/createComponentContext.js +0 -1
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironment.js +0 -1
- package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +2 -5
- package/dist/pipeline/src/context/getEnvironmentVariables.js +9 -19
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/context/resolveReferences.d.ts +0 -3
- package/dist/pipeline/src/context/resolveReferences.js +1 -10
- package/dist/pipeline/src/context/resolveReferences.js.map +1 -1
- package/dist/pipeline/src/deploy/base/deploy.js +3 -4
- package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/index.js +2 -2
- package/dist/pipeline/src/deploy/cloudRun/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +3 -15
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js +0 -2
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/index.js +2 -2
- package/dist/pipeline/src/deploy/kubernetes/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +1 -2
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +2 -3
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
- package/dist/pipeline/src/deploy/types/base.d.ts +0 -6
- package/dist/pipeline/src/deploy/types/kubernetes.d.ts +1 -34
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +2 -4
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/types/config.d.ts +0 -8
- package/dist/pipeline/src/types/context.d.ts +0 -8
- package/dist/pipeline/src/types/context.js.map +1 -1
- package/dist/pipeline/src/types/jobs.d.ts +0 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.d.ts +0 -85
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js +0 -27
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js.map +0 -1
|
@@ -1063,7 +1063,7 @@ const constants_1 = __nccwpck_require__(2786);
|
|
|
1063
1063
|
const writeBuildInfo_1 = __nccwpck_require__(9578);
|
|
1064
1064
|
const writeDotEnv_1 = __nccwpck_require__(8052);
|
|
1065
1065
|
const createAppBuildJob = (context, { script, variables, runnerVariables, cache, ...def }) => {
|
|
1066
|
-
var _a
|
|
1066
|
+
var _a;
|
|
1067
1067
|
return (0, lodash_1.merge)({
|
|
1068
1068
|
name: constants_1.APP_BUILD_JOB_NAME,
|
|
1069
1069
|
envMode: "jobPerEnv",
|
|
@@ -1077,14 +1077,13 @@ const createAppBuildJob = (context, { script, variables, runnerVariables, cache,
|
|
|
1077
1077
|
? {
|
|
1078
1078
|
...context.environment.envVars,
|
|
1079
1079
|
...context.environment.jobOnlyVars.build.envVars,
|
|
1080
|
-
...((_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
1081
1080
|
}
|
|
1082
1081
|
: {}),
|
|
1083
1082
|
},
|
|
1084
1083
|
runnerVariables: {
|
|
1085
1084
|
...constants_1.RUNNER_BUILD_RESOURCE_VARIABLES,
|
|
1086
1085
|
...(runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}),
|
|
1087
|
-
...((
|
|
1086
|
+
...((_a = context.build.config.runnerVariables) !== null && _a !== void 0 ? _a : {}),
|
|
1088
1087
|
},
|
|
1089
1088
|
script: [
|
|
1090
1089
|
...(context.type === "component"
|
|
@@ -1484,7 +1483,7 @@ const RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
|
1484
1483
|
KUBERNETES_MEMORY_LIMIT: "4Gi",
|
|
1485
1484
|
};
|
|
1486
1485
|
const createCustomTestJobs = (context) => {
|
|
1487
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
1486
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1488
1487
|
// don't run tests after release
|
|
1489
1488
|
// TODO: this will be replaced by using rules
|
|
1490
1489
|
if (context.trigger === "taggedRelease") {
|
|
@@ -1498,7 +1497,6 @@ const createCustomTestJobs = (context) => {
|
|
|
1498
1497
|
variables: {
|
|
1499
1498
|
APP_PATH: context.build.dir,
|
|
1500
1499
|
...context.environment.jobOnlyVars.build.envVars,
|
|
1501
|
-
...((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
1502
1500
|
},
|
|
1503
1501
|
runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
|
|
1504
1502
|
services: buildConfig.jobServices,
|
|
@@ -1511,29 +1509,29 @@ const createCustomTestJobs = (context) => {
|
|
|
1511
1509
|
? {
|
|
1512
1510
|
name: "🛡 audit",
|
|
1513
1511
|
...base,
|
|
1514
|
-
image: (
|
|
1512
|
+
image: (_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : buildConfig.jobImage,
|
|
1515
1513
|
cache: undefined,
|
|
1516
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1514
|
+
script: [...(0, utils_1.ensureArray)((_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.command)],
|
|
1517
1515
|
allow_failure: true,
|
|
1518
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1516
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.artifactsReports, (_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.artifacts),
|
|
1519
1517
|
}
|
|
1520
1518
|
: null;
|
|
1521
1519
|
const lintJob = buildConfig.lint
|
|
1522
1520
|
? {
|
|
1523
1521
|
name: "👮 lint",
|
|
1524
1522
|
...base,
|
|
1525
|
-
image: (
|
|
1526
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1527
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1523
|
+
image: (_g = (_f = buildConfig.lint) === null || _f === void 0 ? void 0 : _f.jobImage) !== null && _g !== void 0 ? _g : buildConfig.jobImage,
|
|
1524
|
+
script: [...(0, utils_1.ensureArray)((_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.command)],
|
|
1525
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.artifactsReports, (_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.artifacts),
|
|
1528
1526
|
}
|
|
1529
1527
|
: null;
|
|
1530
1528
|
const testJob = buildConfig.test
|
|
1531
1529
|
? {
|
|
1532
1530
|
name: "🧪 test",
|
|
1533
1531
|
...base,
|
|
1534
|
-
image: (
|
|
1535
|
-
script: [...(0, utils_1.ensureArray)((
|
|
1536
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
1532
|
+
image: (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : buildConfig.jobImage,
|
|
1533
|
+
script: [...(0, utils_1.ensureArray)((_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.command)],
|
|
1534
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.artifactsReports, (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.artifacts),
|
|
1537
1535
|
}
|
|
1538
1536
|
: null;
|
|
1539
1537
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
@@ -1880,6 +1878,7 @@ const getYarnCache = (context, policy = "pull-push") => {
|
|
|
1880
1878
|
return [
|
|
1881
1879
|
{
|
|
1882
1880
|
scope: componentIsInWorkspace ? "global" : "buildDir",
|
|
1881
|
+
pathMode: componentIsInWorkspace ? "absolute" : "relative",
|
|
1883
1882
|
key: "yarn",
|
|
1884
1883
|
policy,
|
|
1885
1884
|
paths: [".yarn"],
|
|
@@ -2071,7 +2070,7 @@ const constants_1 = __nccwpck_require__(1765);
|
|
|
2071
2070
|
const yarn_1 = __nccwpck_require__(5043);
|
|
2072
2071
|
const createJobCache_1 = __nccwpck_require__(4372);
|
|
2073
2072
|
const createNodeTestJobs = (context) => {
|
|
2074
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
2073
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
2075
2074
|
// don't run tests after release
|
|
2076
2075
|
// TODO: this will be replaced by using rules
|
|
2077
2076
|
if (context.trigger === "taggedRelease") {
|
|
@@ -2089,7 +2088,6 @@ const createNodeTestJobs = (context) => {
|
|
|
2089
2088
|
...(context.type === "component"
|
|
2090
2089
|
? {
|
|
2091
2090
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2092
|
-
...((_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
2093
2091
|
}
|
|
2094
2092
|
: {}),
|
|
2095
2093
|
},
|
|
@@ -2104,48 +2102,48 @@ const createNodeTestJobs = (context) => {
|
|
|
2104
2102
|
? {
|
|
2105
2103
|
name: "🛡 audit",
|
|
2106
2104
|
...base,
|
|
2107
|
-
image: (
|
|
2105
|
+
image: (_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : defaultImage,
|
|
2108
2106
|
cache: undefined, // audit does not need yarn install and no cache
|
|
2109
2107
|
script: [
|
|
2110
2108
|
`cd ${context.build.dir}`,
|
|
2111
|
-
...((
|
|
2109
|
+
...((_d = (0, utils_1.ensureArrayOrNull)((_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : [
|
|
2112
2110
|
context.packageManagerInfo.isClassic
|
|
2113
2111
|
? "yarn audit"
|
|
2114
2112
|
: "yarn npm audit --environment production", // yarn 2
|
|
2115
2113
|
]),
|
|
2116
2114
|
],
|
|
2117
2115
|
allow_failure: true,
|
|
2118
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2116
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.artifactsReports, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifacts),
|
|
2119
2117
|
}
|
|
2120
2118
|
: null;
|
|
2121
2119
|
const lintJob = buildConfig.lint !== false
|
|
2122
2120
|
? {
|
|
2123
2121
|
name: "👮 lint",
|
|
2124
2122
|
...base,
|
|
2125
|
-
image: (
|
|
2123
|
+
image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
|
|
2126
2124
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
2127
2125
|
script: [
|
|
2128
2126
|
...(0, yarn_1.ensureNodeVersion)(context),
|
|
2129
2127
|
`cd ${context.build.dir}`,
|
|
2130
2128
|
...yarnInstall,
|
|
2131
|
-
...((
|
|
2129
|
+
...((_k = (0, utils_1.ensureArrayOrNull)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : ["yarn lint"]),
|
|
2132
2130
|
],
|
|
2133
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2131
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.artifactsReports, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifacts),
|
|
2134
2132
|
}
|
|
2135
2133
|
: null;
|
|
2136
2134
|
const testJob = buildConfig.test !== false
|
|
2137
2135
|
? {
|
|
2138
2136
|
name: "🧪 test",
|
|
2139
2137
|
...base,
|
|
2140
|
-
image: (
|
|
2138
|
+
image: (_p = (_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
2141
2139
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
2142
2140
|
script: [
|
|
2143
2141
|
...(0, yarn_1.ensureNodeVersion)(context),
|
|
2144
2142
|
`cd ${context.build.dir}`,
|
|
2145
2143
|
...yarnInstall,
|
|
2146
|
-
...((
|
|
2144
|
+
...((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : ["yarn test"]),
|
|
2147
2145
|
],
|
|
2148
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
2146
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.artifactsReports, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifacts),
|
|
2149
2147
|
}
|
|
2150
2148
|
: null;
|
|
2151
2149
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
@@ -2261,7 +2259,6 @@ const createRailsBuildJobs = (context) => {
|
|
|
2261
2259
|
dockerBuild: {
|
|
2262
2260
|
variables: {
|
|
2263
2261
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2264
|
-
...context.build.config.extraVars,
|
|
2265
2262
|
},
|
|
2266
2263
|
// custom script
|
|
2267
2264
|
script: [
|
|
@@ -2309,7 +2306,7 @@ exports.createRailsTestJobs = void 0;
|
|
|
2309
2306
|
const __1 = __nccwpck_require__(603);
|
|
2310
2307
|
const utils_1 = __nccwpck_require__(2497);
|
|
2311
2308
|
const createRailsTestJobs = (context) => {
|
|
2312
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
2309
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2313
2310
|
// don't run tests after release
|
|
2314
2311
|
// TODO: this will be replaced by using rules
|
|
2315
2312
|
if (context.trigger === "taggedRelease") {
|
|
@@ -2323,7 +2320,6 @@ const createRailsTestJobs = (context) => {
|
|
|
2323
2320
|
const base = {
|
|
2324
2321
|
variables: {
|
|
2325
2322
|
...context.environment.jobOnlyVars.build.envVars,
|
|
2326
|
-
...((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
2327
2323
|
},
|
|
2328
2324
|
stage: "test",
|
|
2329
2325
|
needs: [],
|
|
@@ -2347,10 +2343,10 @@ const createRailsTestJobs = (context) => {
|
|
|
2347
2343
|
name: "🛡 audit",
|
|
2348
2344
|
...base,
|
|
2349
2345
|
cache: undefined, // audit does not need bundle install and no cache
|
|
2350
|
-
image: (
|
|
2346
|
+
image: (_c = (_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : buildConfig.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
|
|
2351
2347
|
script: [
|
|
2352
2348
|
`cd ${context.build.dir}`,
|
|
2353
|
-
...((
|
|
2349
|
+
...((_e = (0, utils_1.ensureArrayOrNull)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
2354
2350
|
"gem install bundler-audit",
|
|
2355
2351
|
"bundle audit check",
|
|
2356
2352
|
]),
|
|
@@ -2363,11 +2359,11 @@ const createRailsTestJobs = (context) => {
|
|
|
2363
2359
|
name: "👮 lint",
|
|
2364
2360
|
...base,
|
|
2365
2361
|
cache: bundlerCache,
|
|
2366
|
-
image: (
|
|
2362
|
+
image: (_h = (_g = (_f = buildConfig.lint) === null || _f === void 0 ? void 0 : _f.jobImage) !== null && _g !== void 0 ? _g : buildConfig.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
|
|
2367
2363
|
script: [
|
|
2368
2364
|
`cd ${context.build.dir}`,
|
|
2369
2365
|
...bundlerInstall,
|
|
2370
|
-
...((
|
|
2366
|
+
...((_k = (0, utils_1.ensureArrayOrNull)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : [
|
|
2371
2367
|
"bundle exec rubocop",
|
|
2372
2368
|
]),
|
|
2373
2369
|
],
|
|
@@ -2378,11 +2374,11 @@ const createRailsTestJobs = (context) => {
|
|
|
2378
2374
|
name: "🧪 test",
|
|
2379
2375
|
...base,
|
|
2380
2376
|
cache: bundlerCache,
|
|
2381
|
-
image: (
|
|
2377
|
+
image: (_o = (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : buildConfig.jobImage) !== null && _o !== void 0 ? _o : defaultImage,
|
|
2382
2378
|
script: [
|
|
2383
2379
|
`cd ${context.build.dir}`,
|
|
2384
2380
|
...bundlerInstall,
|
|
2385
|
-
...((
|
|
2381
|
+
...((_q = (0, utils_1.ensureArrayOrNull)((_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.command)) !== null && _q !== void 0 ? _q : [
|
|
2386
2382
|
"bundle exec rspec",
|
|
2387
2383
|
]),
|
|
2388
2384
|
],
|
|
@@ -2699,7 +2695,6 @@ const createComponentContext = async (ctx) => {
|
|
|
2699
2695
|
const context = {
|
|
2700
2696
|
type: "component",
|
|
2701
2697
|
name: ctx.componentName,
|
|
2702
|
-
componentName: ctx.componentName,
|
|
2703
2698
|
env: ctx.env,
|
|
2704
2699
|
fullConfig: ctx.config,
|
|
2705
2700
|
componentConfig,
|
|
@@ -2872,7 +2867,6 @@ const getEnvironment = async (ctx) => {
|
|
|
2872
2867
|
slugPrefix: envContext.environmentSlugPrefix,
|
|
2873
2868
|
reviewSlug: envContext.reviewSlug,
|
|
2874
2869
|
slug: envContext.environmentSlug,
|
|
2875
|
-
shortName: env,
|
|
2876
2870
|
...variables,
|
|
2877
2871
|
};
|
|
2878
2872
|
};
|
|
@@ -2932,7 +2926,6 @@ exports.getEnvironmentContext = getEnvironmentContext;
|
|
|
2932
2926
|
|
|
2933
2927
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2934
2928
|
exports.getSecretVarNameForContext = exports.getSecretVarName = exports.getEnvironmentVariables = void 0;
|
|
2935
|
-
const lodash_1 = __nccwpck_require__(3255);
|
|
2936
2929
|
const deploy_1 = __nccwpck_require__(8483);
|
|
2937
2930
|
const BashExpression_1 = __nccwpck_require__(2376);
|
|
2938
2931
|
const types_1 = __nccwpck_require__(4466);
|
|
@@ -2950,7 +2943,7 @@ const getBasePredefinedVariables = (ctx) => {
|
|
|
2950
2943
|
};
|
|
2951
2944
|
};
|
|
2952
2945
|
const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
|
|
2953
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
2946
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2954
2947
|
const environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
2955
2948
|
const { config, env, componentName } = ctx;
|
|
2956
2949
|
const { envConfigRaw, deployConfigRaw, buildConfigRaw, envType } = environmentContext;
|
|
@@ -2967,12 +2960,8 @@ const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
|
|
|
2967
2960
|
...basePredefinedVariables,
|
|
2968
2961
|
ENV_SHORT: "local",
|
|
2969
2962
|
ROOT_URL: url,
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
buildConfigRaw.type === "rails"
|
|
2973
|
-
? {}
|
|
2974
|
-
: { HOST: host }),
|
|
2975
|
-
HOST_INTERNAL: host,
|
|
2963
|
+
HOSTNAME: host,
|
|
2964
|
+
HOSTNAME_INTERNAL: host,
|
|
2976
2965
|
ROOT_URL_INTERNAL: "http://" + host,
|
|
2977
2966
|
PORT: port.toString(),
|
|
2978
2967
|
};
|
|
@@ -2981,8 +2970,8 @@ const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
|
|
|
2981
2970
|
const additionalEnvVars = deployConfigRaw
|
|
2982
2971
|
? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext)
|
|
2983
2972
|
: {};
|
|
2984
|
-
const
|
|
2985
|
-
host = (_c = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _c !== void 0 ? _c :
|
|
2973
|
+
const HOSTNAME_INTERNAL = (_b = additionalEnvVars.HOSTNAME_INTERNAL) !== null && _b !== void 0 ? _b : "unknown-host.example.com";
|
|
2974
|
+
host = (_c = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _c !== void 0 ? _c : HOSTNAME_INTERNAL;
|
|
2986
2975
|
url = (0, BashExpression_1.joinBashExpressions)(["https://", host]);
|
|
2987
2976
|
predefinedVariables = {
|
|
2988
2977
|
...basePredefinedVariables,
|
|
@@ -2990,12 +2979,10 @@ const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
|
|
|
2990
2979
|
...((0, types_1.isStandaloneBuildConfig)(buildConfigRaw) &&
|
|
2991
2980
|
buildConfigRaw.type === "rails"
|
|
2992
2981
|
? {}
|
|
2993
|
-
: {
|
|
2982
|
+
: { HOSTNAME: host }),
|
|
2994
2983
|
ROOT_URL: url,
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
HOST_CANONICAL: HOST_INTERNAL, // legacy alias for HOST_INTERNAL
|
|
2998
|
-
ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOST_INTERNAL]),
|
|
2984
|
+
HOSTNAME_INTERNAL,
|
|
2985
|
+
ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOSTNAME_INTERNAL]),
|
|
2999
2986
|
...additionalEnvVars,
|
|
3000
2987
|
};
|
|
3001
2988
|
}
|
|
@@ -3008,10 +2995,7 @@ const getEnvironmentVariables = async (ctx, alreadyVisited = {}) => {
|
|
|
3008
2995
|
...additionalSecretKeys,
|
|
3009
2996
|
];
|
|
3010
2997
|
const secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
|
|
3011
|
-
|
|
3012
|
-
const legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
|
|
3013
|
-
const publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
|
|
3014
|
-
const publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
|
|
2998
|
+
const publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRaw);
|
|
3015
2999
|
const envVarsRaw = addIndexVar({
|
|
3016
3000
|
...predefinedVariables,
|
|
3017
3001
|
...secretEnvVars,
|
|
@@ -3150,7 +3134,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3150
3134
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3151
3135
|
};
|
|
3152
3136
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3153
|
-
exports.
|
|
3137
|
+
exports.resolveReferences = void 0;
|
|
3154
3138
|
const lodash_1 = __nccwpck_require__(3255);
|
|
3155
3139
|
const replaceAsync_1 = __importDefault(__nccwpck_require__(2233));
|
|
3156
3140
|
// regex to resolve references in catladder variables
|
|
@@ -3200,15 +3184,6 @@ const resolveReferences = async (vars, getOtherVariables, alreadyVisitedBase = {
|
|
|
3200
3184
|
})));
|
|
3201
3185
|
};
|
|
3202
3186
|
exports.resolveReferences = resolveReferences;
|
|
3203
|
-
const translateLegacyFromComponents = (fromComponents) => {
|
|
3204
|
-
return Object.fromEntries(Object.entries(fromComponents).flatMap(([componentName, variables]) => {
|
|
3205
|
-
return Object.entries(variables).map(([ourName, otherName]) => [
|
|
3206
|
-
ourName,
|
|
3207
|
-
"${" + componentName + ":" + otherName + "}",
|
|
3208
|
-
]);
|
|
3209
|
-
}));
|
|
3210
|
-
};
|
|
3211
|
-
exports.translateLegacyFromComponents = translateLegacyFromComponents;
|
|
3212
3187
|
//# sourceMappingURL=resolveReferences.js.map
|
|
3213
3188
|
|
|
3214
3189
|
/***/ }),
|
|
@@ -3314,7 +3289,7 @@ const stop_1 = __nccwpck_require__(2846);
|
|
|
3314
3289
|
const variables_1 = __nccwpck_require__(2422);
|
|
3315
3290
|
exports.DEPLOY_JOB_NAME = "🚀 Deploy";
|
|
3316
3291
|
const createDeployJob = (context, jobDefinition) => {
|
|
3317
|
-
var _a, _b, _c, _d, _e, _f
|
|
3292
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3318
3293
|
const hasDocker = (0, docker_1.requiresDockerBuild)(context);
|
|
3319
3294
|
const isStoppable = (0, utils_1.contextIsStoppable)(context);
|
|
3320
3295
|
const autoStop = context.environment.envType === "review"
|
|
@@ -3393,13 +3368,12 @@ const createDeployJob = (context, jobDefinition) => {
|
|
|
3393
3368
|
...context.environment.envVars,
|
|
3394
3369
|
...(hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}),
|
|
3395
3370
|
...context.environment.jobOnlyVars.deploy.envVars,
|
|
3396
|
-
...(deployConfig ? (_e = deployConfig.extraVars) !== null && _e !== void 0 ? _e : {} : {}),
|
|
3397
3371
|
...jobDefinition.variables,
|
|
3398
3372
|
},
|
|
3399
3373
|
runnerVariables: {
|
|
3400
3374
|
...variables_1.DEPLOY_RUNNER_VARIABLES,
|
|
3401
|
-
...((
|
|
3402
|
-
...(deployConfig ? (
|
|
3375
|
+
...((_e = jobDefinition.runnerVariables) !== null && _e !== void 0 ? _e : {}),
|
|
3376
|
+
...(deployConfig ? (_f = deployConfig.runnerVariables) !== null && _f !== void 0 ? _f : {} : {}),
|
|
3403
3377
|
},
|
|
3404
3378
|
environment: isStoppable
|
|
3405
3379
|
? {
|
|
@@ -4248,7 +4222,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
4248
4222
|
],
|
|
4249
4223
|
getAdditionalEnvVars: (ctx) => {
|
|
4250
4224
|
const { fullName, env, componentName, deployConfigRaw } = ctx;
|
|
4251
|
-
const
|
|
4225
|
+
const HOSTNAME_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
|
|
4252
4226
|
fullName,
|
|
4253
4227
|
(0, BashExpression_1.getBashVariable)((0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)),
|
|
4254
4228
|
], "-").toLowerCase();
|
|
@@ -4259,7 +4233,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
4259
4233
|
]))
|
|
4260
4234
|
: {};
|
|
4261
4235
|
return {
|
|
4262
|
-
|
|
4236
|
+
HOSTNAME_INTERNAL,
|
|
4263
4237
|
...getCloudSqlVariables(ctx),
|
|
4264
4238
|
...jobTriggers,
|
|
4265
4239
|
DEPLOY_CLOUD_RUN_PROJECT_ID: deployConfigRaw
|
|
@@ -4671,7 +4645,7 @@ const hasKubernetesCloudSQL = (context) => {
|
|
|
4671
4645
|
};
|
|
4672
4646
|
exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
|
|
4673
4647
|
const createKubernetesCloudsqlBaseValues = (context) => {
|
|
4674
|
-
var _a, _b, _c
|
|
4648
|
+
var _a, _b, _c;
|
|
4675
4649
|
const deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
4676
4650
|
if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
4677
4651
|
throw new Error("cannot get cloud sql config");
|
|
@@ -4681,23 +4655,11 @@ const createKubernetesCloudsqlBaseValues = (context) => {
|
|
|
4681
4655
|
throw new Error("cannot get cloud sql config");
|
|
4682
4656
|
}
|
|
4683
4657
|
const proxyCredentials = `$${(0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials")}`;
|
|
4684
|
-
if (
|
|
4685
|
-
const instanceConnectionName = `${(_c = config.projectId) !== null && _c !== void 0 ? _c : "skynet-164509"}:${(_d = config.region) !== null && _d !== void 0 ? _d : "europe-west6"}:${(_e = config.instanceId) !== null && _e !== void 0 ? _e : context.environment.envVars.KUBE_NAMESPACE}`;
|
|
4658
|
+
if (config.type === "unmanaged") {
|
|
4686
4659
|
return {
|
|
4687
4660
|
cloudsql: {
|
|
4688
4661
|
enabled: config.enabled,
|
|
4689
|
-
dbUser: "postgres",
|
|
4690
|
-
instanceConnectionName,
|
|
4691
|
-
proxyCredentials,
|
|
4692
|
-
fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : "",
|
|
4693
|
-
},
|
|
4694
|
-
};
|
|
4695
|
-
}
|
|
4696
|
-
else if (config.type === "unmanaged") {
|
|
4697
|
-
return {
|
|
4698
|
-
cloudsql: {
|
|
4699
|
-
enabled: config.enabled,
|
|
4700
|
-
dbUser: (_g = config.dbUser) !== null && _g !== void 0 ? _g : "postgres",
|
|
4662
|
+
dbUser: (_c = config.dbUser) !== null && _c !== void 0 ? _c : "postgres",
|
|
4701
4663
|
instanceConnectionName: config.instanceConnectionName,
|
|
4702
4664
|
proxyCredentials,
|
|
4703
4665
|
fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.name),
|
|
@@ -4759,8 +4721,6 @@ const createKubernetesDeployJobs = (context) => {
|
|
|
4759
4721
|
...((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : []),
|
|
4760
4722
|
].join(" "),
|
|
4761
4723
|
COMPONENT_NAME: context.name,
|
|
4762
|
-
/** @deprecated */
|
|
4763
|
-
BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID,
|
|
4764
4724
|
},
|
|
4765
4725
|
};
|
|
4766
4726
|
const clusterName = `kube-${context.environment.fullName}`;
|
|
@@ -4844,7 +4804,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
|
|
|
4844
4804
|
const domainCanonical = (deployConfigRaw && ((_a = deployConfigRaw.cluster) === null || _a === void 0 ? void 0 : _a.domainCanonical)) || // for convenience, we allow clusters to define a canonical domain, because a cluster has a fixed ip and you will usually have a domain pointing to that cluster
|
|
4845
4805
|
fullConfig.domainCanonical ||
|
|
4846
4806
|
"panter.cloud";
|
|
4847
|
-
const
|
|
4807
|
+
const HOSTNAME_INTERNAL = (0, BashExpression_1.joinBashExpressions)([
|
|
4848
4808
|
componentSlug,
|
|
4849
4809
|
...(envType === "review" && reviewSlug ? [reviewSlug] : []),
|
|
4850
4810
|
env,
|
|
@@ -4856,7 +4816,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
|
|
|
4856
4816
|
KUBE_NAMESPACE,
|
|
4857
4817
|
KUBE_APP_NAME,
|
|
4858
4818
|
KUBE_APP_NAME_PREFIX,
|
|
4859
|
-
|
|
4819
|
+
HOSTNAME_INTERNAL,
|
|
4860
4820
|
};
|
|
4861
4821
|
},
|
|
4862
4822
|
};
|
|
@@ -4929,7 +4889,6 @@ const types_1 = __nccwpck_require__(5781);
|
|
|
4929
4889
|
const cloudSql_1 = __nccwpck_require__(5129);
|
|
4930
4890
|
const kubeEnv_1 = __nccwpck_require__(6769);
|
|
4931
4891
|
const mongodb_1 = __nccwpck_require__(4139);
|
|
4932
|
-
const processSecretsAsFiles_1 = __nccwpck_require__(6089);
|
|
4933
4892
|
const createAppConfig = (context, application) => {
|
|
4934
4893
|
if (application === false) {
|
|
4935
4894
|
return {
|
|
@@ -4986,11 +4945,11 @@ const createKubeValues = (context) => {
|
|
|
4986
4945
|
: {}, ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled)
|
|
4987
4946
|
? (0, mongodb_1.createMongodbBaseConfig)(context)
|
|
4988
4947
|
: {});
|
|
4989
|
-
const kubeValues = (0,
|
|
4948
|
+
const kubeValues = (0, utils_1.mergeWithMergingArrays)(defaultKubeValues, {
|
|
4990
4949
|
jobs: removeFalsy(jobs),
|
|
4991
4950
|
cronjobs: removeFalsy(cronjobs),
|
|
4992
4951
|
...rest,
|
|
4993
|
-
})
|
|
4952
|
+
});
|
|
4994
4953
|
return kubeValues;
|
|
4995
4954
|
};
|
|
4996
4955
|
exports.createKubeValues = createKubeValues;
|
|
@@ -5109,40 +5068,6 @@ exports.createMongodbBaseConfig = createMongodbBaseConfig;
|
|
|
5109
5068
|
|
|
5110
5069
|
/***/ }),
|
|
5111
5070
|
|
|
5112
|
-
/***/ 6089:
|
|
5113
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5114
|
-
|
|
5115
|
-
"use strict";
|
|
5116
|
-
|
|
5117
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5118
|
-
exports.processSecretsAsFiles = void 0;
|
|
5119
|
-
const lodash_1 = __nccwpck_require__(3255);
|
|
5120
|
-
const processSecretsAsFiles = (values) => {
|
|
5121
|
-
if (!values.secretsAsFile || values.secretsAsFile.length === 0) {
|
|
5122
|
-
return values;
|
|
5123
|
-
}
|
|
5124
|
-
// the initial idea was that we "shadow" secrets that we mount as files,
|
|
5125
|
-
// but there is a weird kubernetes issue with that (https://github.com/kubernetes/kubernetes/issues/46861),
|
|
5126
|
-
// so instead we rename the secrets and append _content, so that inside kuberentes, we can use the original name to contain the path and name+_content as the actual content
|
|
5127
|
-
return {
|
|
5128
|
-
...values,
|
|
5129
|
-
env: {
|
|
5130
|
-
...values.env,
|
|
5131
|
-
secret: {
|
|
5132
|
-
...(0, lodash_1.omit)(values.env.secret, values.secretsAsFile),
|
|
5133
|
-
...Object.fromEntries(values.secretsAsFile.map((key) => [
|
|
5134
|
-
key + "_content",
|
|
5135
|
-
values.env.secret[key],
|
|
5136
|
-
])),
|
|
5137
|
-
},
|
|
5138
|
-
},
|
|
5139
|
-
};
|
|
5140
|
-
};
|
|
5141
|
-
exports.processSecretsAsFiles = processSecretsAsFiles;
|
|
5142
|
-
//# sourceMappingURL=processSecretsAsFiles.js.map
|
|
5143
|
-
|
|
5144
|
-
/***/ }),
|
|
5145
|
-
|
|
5146
5071
|
/***/ 4986:
|
|
5147
5072
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5148
5073
|
|
|
@@ -5719,7 +5644,7 @@ const getFullReferencedJobNameFromWorkspace = (referencedJobName, workspaceName,
|
|
|
5719
5644
|
const getJobName = (need) => (0, lodash_1.isObject)(need) ? need.job : need;
|
|
5720
5645
|
const makeGitlabJob = (context, job, allJobs, baseRules) => {
|
|
5721
5646
|
var _a, _b;
|
|
5722
|
-
const { environment, envMode, needsStages,
|
|
5647
|
+
const { environment, envMode, needsStages, name, needs, jobTags, script, variables, runnerVariables, when, ...rest } = job;
|
|
5723
5648
|
const stage = envMode === "stagePerEnv" ? `${job.stage} ${context.env}` : job.stage;
|
|
5724
5649
|
const deduplicatedGitlabNeeds = getGitlabNeeds(context, job, allJobs);
|
|
5725
5650
|
const fullJobName = getFullJobName({
|
|
@@ -5843,7 +5768,7 @@ function deduplicateNeeds(needs) {
|
|
|
5843
5768
|
? [...new Map(needs.map((n) => [(0, lodash_1.isObject)(n) ? n.job : n, n])).values()]
|
|
5844
5769
|
: undefined;
|
|
5845
5770
|
}
|
|
5846
|
-
function getGitlabNeedsForComponentJob(context, { needsStages, needs
|
|
5771
|
+
function getGitlabNeedsForComponentJob(context, { needsStages, needs }, allJobs) {
|
|
5847
5772
|
const needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap((n) => {
|
|
5848
5773
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5849
5774
|
const componentName = context.name;
|
|
@@ -5877,8 +5802,6 @@ function getGitlabNeedsForComponentJob(context, { needsStages, needs, needsOther
|
|
|
5877
5802
|
const cleanedNeeds = [
|
|
5878
5803
|
...(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []),
|
|
5879
5804
|
...(needs !== null && needs !== void 0 ? needs : []),
|
|
5880
|
-
// pull in legacy needs from other component, which is now identical to needs
|
|
5881
|
-
...(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []),
|
|
5882
5805
|
];
|
|
5883
5806
|
return cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map((n) => {
|
|
5884
5807
|
var _a;
|