@catladder/pipeline 0.0.0-next-9a3feef4 → 0.0.0-next-e2e4f00a
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/build/base/createAppBuildJob.js +3 -3
- package/dist/build/custom/testJob.js +12 -12
- package/dist/build/node/testJob.js +11 -11
- package/dist/build/rails/build.js +1 -1
- package/dist/build/rails/test.js +8 -8
- package/dist/build/types.d.ts +10 -0
- package/dist/bundles/catladder-gitlab/index.js +150 -71
- package/dist/constants.js +1 -1
- package/dist/context/__tests__/resolveReferences.test.js +22 -0
- package/dist/context/createComponentContext.js +1 -0
- package/dist/context/getEnvironment.js +2 -1
- package/dist/context/getEnvironmentVariables.d.ts +5 -2
- package/dist/context/getEnvironmentVariables.js +24 -17
- package/dist/context/resolveReferences.d.ts +4 -1
- package/dist/context/resolveReferences.js +16 -2
- package/dist/deploy/base/deploy.js +3 -3
- package/dist/deploy/cloudRun/index.js +2 -2
- package/dist/deploy/kubernetes/cloudSql/index.js +14 -3
- package/dist/deploy/kubernetes/deployJob.js +3 -1
- package/dist/deploy/kubernetes/index.js +2 -2
- package/dist/deploy/kubernetes/kubeValues.d.ts +2 -1
- package/dist/deploy/kubernetes/kubeValues.js +3 -2
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +85 -0
- package/dist/deploy/kubernetes/processSecretsAsFiles.js +33 -0
- package/dist/deploy/types/base.d.ts +6 -0
- package/dist/deploy/types/kubernetes.d.ts +34 -1
- package/dist/pipeline/gitlab/createGitlabJobs.js +5 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +8 -0
- package/dist/types/context.d.ts +8 -0
- package/dist/types/jobs.d.ts +8 -0
- package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +52 -36
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +104 -72
- package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +68 -48
- package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +52 -36
- package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +52 -36
- package/examples/__snapshots__/custom-build-job.test.ts.snap +52 -36
- package/examples/__snapshots__/custom-deploy.test.ts.snap +32 -24
- package/examples/__snapshots__/custom-envs.test.ts.snap +24 -18
- package/examples/__snapshots__/custom-sbom-java.test.ts.snap +52 -36
- package/examples/__snapshots__/git-submodule.test.ts.snap +52 -36
- package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +96 -60
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.test.ts.snap +1791 -0
- package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +96 -60
- package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +192 -120
- package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +96 -60
- package/examples/__snapshots__/local-dot-env.test.ts.snap +52 -36
- package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +96 -60
- package/examples/__snapshots__/multiline-var.test.ts.snap +148 -96
- package/examples/__snapshots__/native-app.test.ts.snap +100 -72
- package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +52 -36
- package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +52 -36
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +80 -48
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +80 -48
- package/examples/__snapshots__/wait-for-other-deploy.test.ts.snap +64 -48
- package/examples/__snapshots__/workspace-api-www-custom-cache.test.ts.snap +104 -72
- package/examples/__snapshots__/workspace-api-www.test.ts.snap +104 -72
- package/examples/kubernetes-with-cloud-sql-legacy.test.ts +11 -0
- package/examples/kubernetes-with-cloud-sql-legacy.ts +35 -0
- package/examples/native-app.ts +6 -10
- package/examples/rails-k8s-with-worker.ts +1 -5
- package/package.json +1 -1
- package/src/build/base/createAppBuildJob.ts +1 -0
- package/src/build/custom/testJob.ts +1 -0
- package/src/build/node/testJob.ts +1 -0
- package/src/build/rails/build.ts +1 -0
- package/src/build/rails/test.ts +1 -0
- package/src/build/types.ts +13 -0
- package/src/context/__tests__/resolveReferences.test.ts +27 -1
- package/src/context/createComponentContext.ts +1 -0
- package/src/context/getEnvironment.ts +1 -1
- package/src/context/getEnvironmentVariables.ts +34 -13
- package/src/context/resolveReferences.ts +13 -0
- package/src/deploy/base/deploy.ts +1 -1
- package/src/deploy/cloudRun/index.ts +2 -2
- package/src/deploy/kubernetes/cloudSql/index.ts +15 -1
- package/src/deploy/kubernetes/deployJob.ts +2 -0
- package/src/deploy/kubernetes/index.ts +2 -2
- package/src/deploy/kubernetes/kubeValues.ts +8 -5
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +35 -0
- package/src/deploy/types/base.ts +6 -0
- package/src/deploy/types/kubernetes.ts +36 -1
- package/src/pipeline/gitlab/createGitlabJobs.ts +4 -1
- package/src/types/config.ts +8 -0
- package/src/types/context.ts +8 -1
- package/src/types/jobs.ts +8 -0
|
@@ -23359,7 +23359,7 @@ var constants_1 = __nccwpck_require__(8821);
|
|
|
23359
23359
|
var writeBuildInfo_1 = __nccwpck_require__(8014);
|
|
23360
23360
|
var writeDotEnv_1 = __nccwpck_require__(2818);
|
|
23361
23361
|
var createAppBuildJob = function (context, _a) {
|
|
23362
|
-
var _b;
|
|
23362
|
+
var _b, _c;
|
|
23363
23363
|
var script = _a.script,
|
|
23364
23364
|
variables = _a.variables,
|
|
23365
23365
|
runnerVariables = _a.runnerVariables,
|
|
@@ -23372,8 +23372,8 @@ var createAppBuildJob = function (context, _a) {
|
|
|
23372
23372
|
image: (0, __1.getRunnerImage)("jobs-default"),
|
|
23373
23373
|
needs: [],
|
|
23374
23374
|
cache: cache ? (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, cache) : undefined,
|
|
23375
|
-
variables: __assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.type === "component" ? __assign(__assign({}, context.environment.envVars), context.environment.jobOnlyVars.build.envVars) : {}),
|
|
23376
|
-
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}), (
|
|
23375
|
+
variables: __assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.type === "component" ? __assign(__assign(__assign({}, context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.build.config.extraVars) !== null && _b !== void 0 ? _b : {}) : {}),
|
|
23376
|
+
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}), (_c = context.build.config.runnerVariables) !== null && _c !== void 0 ? _c : {}),
|
|
23377
23377
|
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(context.type === "component" ? (0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(context) ? (0, writeDotEnv_1.writeDotEnv)(context) : [] : context.type === "workspace" ? context.components.filter(function (c) {
|
|
23378
23378
|
return (0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(c);
|
|
23379
23379
|
}).flatMap(function (c) {
|
|
@@ -24055,7 +24055,7 @@ var RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
|
24055
24055
|
KUBERNETES_MEMORY_LIMIT: "4Gi"
|
|
24056
24056
|
};
|
|
24057
24057
|
var createCustomTestJobs = function (context) {
|
|
24058
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
24058
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
24059
24059
|
// don't run tests after release
|
|
24060
24060
|
// TODO: this will be replaced by using rules
|
|
24061
24061
|
if (context.trigger === "taggedRelease") {
|
|
@@ -24066,9 +24066,9 @@ var createCustomTestJobs = function (context) {
|
|
|
24066
24066
|
throw new Error("deploy config is not custom");
|
|
24067
24067
|
}
|
|
24068
24068
|
var base = {
|
|
24069
|
-
variables: __assign({
|
|
24069
|
+
variables: __assign(__assign({
|
|
24070
24070
|
APP_PATH: context.build.dir
|
|
24071
|
-
}, context.environment.jobOnlyVars.build.envVars),
|
|
24071
|
+
}, context.environment.jobOnlyVars.build.envVars), (_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
24072
24072
|
runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
|
|
24073
24073
|
services: buildConfig.jobServices,
|
|
24074
24074
|
cache: (0, createJobCache_1.createJobCacheFromConfig)(context, buildConfig),
|
|
@@ -24079,23 +24079,23 @@ var createCustomTestJobs = function (context) {
|
|
|
24079
24079
|
var auditJob = buildConfig.audit ? __assign(__assign(__assign({
|
|
24080
24080
|
name: "🛡 audit"
|
|
24081
24081
|
}, base), {
|
|
24082
|
-
image: (
|
|
24082
|
+
image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage,
|
|
24083
24083
|
cache: undefined,
|
|
24084
|
-
script: __spreadArray([], __read((0, utils_1.ensureArray)((
|
|
24084
|
+
script: __spreadArray([], __read((0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)), false),
|
|
24085
24085
|
allow_failure: true
|
|
24086
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24086
|
+
}), (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)) : null;
|
|
24087
24087
|
var lintJob = buildConfig.lint ? __assign(__assign(__assign({
|
|
24088
24088
|
name: "👮 lint"
|
|
24089
24089
|
}, base), {
|
|
24090
|
-
image: (
|
|
24091
|
-
script: __spreadArray([], __read((0, utils_1.ensureArray)((
|
|
24092
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24090
|
+
image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage,
|
|
24091
|
+
script: __spreadArray([], __read((0, utils_1.ensureArray)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)), false)
|
|
24092
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.artifactsReports, (_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.artifacts)) : null;
|
|
24093
24093
|
var testJob = buildConfig.test ? __assign(__assign(__assign({
|
|
24094
24094
|
name: "🧪 test"
|
|
24095
24095
|
}, base), {
|
|
24096
|
-
image: (
|
|
24097
|
-
script: __spreadArray([], __read((0, utils_1.ensureArray)((
|
|
24098
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24096
|
+
image: (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage,
|
|
24097
|
+
script: __spreadArray([], __read((0, utils_1.ensureArray)((_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.command)), false)
|
|
24098
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.artifactsReports, (_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.artifacts)) : null;
|
|
24099
24099
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
24100
24100
|
};
|
|
24101
24101
|
exports.createCustomTestJobs = createCustomTestJobs;
|
|
@@ -24829,7 +24829,7 @@ var constants_1 = __nccwpck_require__(4899);
|
|
|
24829
24829
|
var yarn_1 = __nccwpck_require__(312);
|
|
24830
24830
|
var createJobCache_1 = __nccwpck_require__(659);
|
|
24831
24831
|
var createNodeTestJobs = function (context) {
|
|
24832
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
24832
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
24833
24833
|
// don't run tests after release
|
|
24834
24834
|
// TODO: this will be replaced by using rules
|
|
24835
24835
|
if (context.trigger === "taggedRelease") {
|
|
@@ -24843,7 +24843,7 @@ var createNodeTestJobs = function (context) {
|
|
|
24843
24843
|
var base = {
|
|
24844
24844
|
variables: __assign({
|
|
24845
24845
|
APP_PATH: context.build.dir
|
|
24846
|
-
}, context.type === "component" ? __assign({}, context.environment.jobOnlyVars.build.envVars) : {}),
|
|
24846
|
+
}, context.type === "component" ? __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (_a = context.build.config.extraVars) !== null && _a !== void 0 ? _a : {}) : {}),
|
|
24847
24847
|
runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
|
|
24848
24848
|
stage: "test",
|
|
24849
24849
|
needs: [],
|
|
@@ -24854,26 +24854,26 @@ var createNodeTestJobs = function (context) {
|
|
|
24854
24854
|
var auditJob = buildConfig.audit !== false ? __assign(__assign(__assign({
|
|
24855
24855
|
name: "🛡 audit"
|
|
24856
24856
|
}, base), {
|
|
24857
|
-
image: (
|
|
24857
|
+
image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
|
|
24858
24858
|
cache: undefined,
|
|
24859
|
-
script: __spreadArray(["cd ".concat(context.build.dir)], __read((
|
|
24859
|
+
script: __spreadArray(["cd ".concat(context.build.dir)], __read((_e = (0, utils_1.ensureArrayOrNull)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [context.packageManagerInfo.isClassic ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
|
|
24860
24860
|
]), false),
|
|
24861
24861
|
allow_failure: true
|
|
24862
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24862
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifactsReports, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifacts)) : null;
|
|
24863
24863
|
var lintJob = buildConfig.lint !== false ? __assign(__assign(__assign({
|
|
24864
24864
|
name: "👮 lint"
|
|
24865
24865
|
}, base), {
|
|
24866
|
-
image: (
|
|
24866
|
+
image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
24867
24867
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
24868
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((
|
|
24869
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24868
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["yarn lint"]), false)
|
|
24869
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifacts)) : null;
|
|
24870
24870
|
var testJob = buildConfig.test !== false ? __assign(__assign(__assign({
|
|
24871
24871
|
name: "🧪 test"
|
|
24872
24872
|
}, base), {
|
|
24873
|
-
image: (
|
|
24873
|
+
image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
24874
24874
|
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
24875
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((
|
|
24876
|
-
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
24875
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read(yarnInstall), false), __read((_s = (0, utils_1.ensureArrayOrNull)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["yarn test"]), false)
|
|
24876
|
+
}), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifacts)) : null;
|
|
24877
24877
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
24878
24878
|
};
|
|
24879
24879
|
exports.createNodeTestJobs = createNodeTestJobs;
|
|
@@ -25046,7 +25046,7 @@ var createRailsBuildJobs = function (context) {
|
|
|
25046
25046
|
return (0, base_1.createComponentBuildJobs)(context, {
|
|
25047
25047
|
appBuild: undefined,
|
|
25048
25048
|
dockerBuild: {
|
|
25049
|
-
variables: __assign({}, context.environment.jobOnlyVars.build.envVars),
|
|
25049
|
+
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.build.config.extraVars),
|
|
25050
25050
|
// custom script
|
|
25051
25051
|
script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), ["cd ".concat(context.build.dir), "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "/pack-v").concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "-linux.tgz | tar -zx --directory /usr/local/bin pack"), "chmod +x /usr/local/bin/pack",
|
|
25052
25052
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
@@ -25162,7 +25162,7 @@ exports.createRailsTestJobs = void 0;
|
|
|
25162
25162
|
var __1 = __nccwpck_require__(3223);
|
|
25163
25163
|
var utils_1 = __nccwpck_require__(1815);
|
|
25164
25164
|
var createRailsTestJobs = function (context) {
|
|
25165
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
25165
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
25166
25166
|
// don't run tests after release
|
|
25167
25167
|
// TODO: this will be replaced by using rules
|
|
25168
25168
|
if (context.trigger === "taggedRelease") {
|
|
@@ -25174,7 +25174,7 @@ var createRailsTestJobs = function (context) {
|
|
|
25174
25174
|
}
|
|
25175
25175
|
var buildConfig = context.build.config;
|
|
25176
25176
|
var base = {
|
|
25177
|
-
variables: __assign({}, context.environment.jobOnlyVars.build.envVars),
|
|
25177
|
+
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
25178
25178
|
stage: "test",
|
|
25179
25179
|
needs: [],
|
|
25180
25180
|
envMode: "none"
|
|
@@ -25194,23 +25194,23 @@ var createRailsTestJobs = function (context) {
|
|
|
25194
25194
|
name: "🛡 audit"
|
|
25195
25195
|
}, base), {
|
|
25196
25196
|
cache: undefined,
|
|
25197
|
-
image: (
|
|
25198
|
-
script: __spreadArray(["cd ".concat(context.build.dir)], __read((
|
|
25197
|
+
image: (_d = (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
|
|
25198
|
+
script: __spreadArray(["cd ".concat(context.build.dir)], __read((_f = (0, utils_1.ensureArrayOrNull)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : ["gem install bundler-audit", "bundle audit check"]), false),
|
|
25199
25199
|
allow_failure: true
|
|
25200
25200
|
}) : null;
|
|
25201
25201
|
var lintJob = buildConfig.lint !== false ? __assign(__assign({
|
|
25202
25202
|
name: "👮 lint"
|
|
25203
25203
|
}, base), {
|
|
25204
25204
|
cache: bundlerCache,
|
|
25205
|
-
image: (
|
|
25206
|
-
script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(bundlerInstall), false), __read((
|
|
25205
|
+
image: (_j = (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
25206
|
+
script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(bundlerInstall), false), __read((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["bundle exec rubocop"]), false)
|
|
25207
25207
|
}) : null;
|
|
25208
25208
|
var testJob = buildConfig.test !== false ? __assign(__assign({
|
|
25209
25209
|
name: "🧪 test"
|
|
25210
25210
|
}, base), {
|
|
25211
25211
|
cache: bundlerCache,
|
|
25212
|
-
image: (
|
|
25213
|
-
script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(bundlerInstall), false), __read((
|
|
25212
|
+
image: (_p = (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage) !== null && _p !== void 0 ? _p : defaultImage,
|
|
25213
|
+
script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(bundlerInstall), false), __read((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : ["bundle exec rspec"]), false)
|
|
25214
25214
|
}) : null;
|
|
25215
25215
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
25216
25216
|
};
|
|
@@ -25763,7 +25763,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
25763
25763
|
value: true
|
|
25764
25764
|
}));
|
|
25765
25765
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
25766
|
-
exports.PIPELINE_IMAGE_TAG = "next-
|
|
25766
|
+
exports.PIPELINE_IMAGE_TAG = "next-e2e4f00a" || 0;
|
|
25767
25767
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
25768
25768
|
|
|
25769
25769
|
/***/ }),
|
|
@@ -26172,6 +26172,7 @@ var createComponentContext = function (ctx) {
|
|
|
26172
26172
|
context = {
|
|
26173
26173
|
type: "component",
|
|
26174
26174
|
name: ctx.componentName,
|
|
26175
|
+
componentName: ctx.componentName,
|
|
26175
26176
|
env: ctx.env,
|
|
26176
26177
|
fullConfig: ctx.config,
|
|
26177
26178
|
componentConfig: componentConfig,
|
|
@@ -26641,7 +26642,8 @@ var getEnvironment = function (ctx) {
|
|
|
26641
26642
|
fullName: envContext.fullName,
|
|
26642
26643
|
slugPrefix: envContext.environmentSlugPrefix,
|
|
26643
26644
|
reviewSlug: envContext.reviewSlug,
|
|
26644
|
-
slug: envContext.environmentSlug
|
|
26645
|
+
slug: envContext.environmentSlug,
|
|
26646
|
+
shortName: env
|
|
26645
26647
|
}, variables)];
|
|
26646
26648
|
}
|
|
26647
26649
|
});
|
|
@@ -26867,6 +26869,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
26867
26869
|
value: true
|
|
26868
26870
|
}));
|
|
26869
26871
|
exports.getSecretVarNameForContext = exports.getSecretVarName = exports.getEnvironmentVariables = void 0;
|
|
26872
|
+
var lodash_1 = __nccwpck_require__(3255);
|
|
26870
26873
|
var deploy_1 = __nccwpck_require__(1264);
|
|
26871
26874
|
var BashExpression_1 = __nccwpck_require__(5879);
|
|
26872
26875
|
var types_1 = __nccwpck_require__(6575);
|
|
@@ -26888,14 +26891,14 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
26888
26891
|
args_1[_i - 1] = arguments[_i];
|
|
26889
26892
|
}
|
|
26890
26893
|
return __awaiter(void 0, __spreadArray([ctx_1], __read(args_1), false), void 0, function (ctx, alreadyVisited) {
|
|
26891
|
-
var environmentContext, config, env, componentName, envConfigRaw, deployConfigRaw, buildConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars,
|
|
26894
|
+
var environmentContext, config, env, componentName, envConfigRaw, deployConfigRaw, buildConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, HOST_INTERNAL, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegacyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
|
|
26892
26895
|
var _a, _b;
|
|
26893
|
-
var _c, _d, _e, _f, _g, _h, _j;
|
|
26896
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
26894
26897
|
if (alreadyVisited === void 0) {
|
|
26895
26898
|
alreadyVisited = {};
|
|
26896
26899
|
}
|
|
26897
|
-
return __generator(this, function (
|
|
26898
|
-
switch (
|
|
26900
|
+
return __generator(this, function (_m) {
|
|
26901
|
+
switch (_m.label) {
|
|
26899
26902
|
case 0:
|
|
26900
26903
|
environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
26901
26904
|
config = ctx.config, env = ctx.env, componentName = ctx.componentName;
|
|
@@ -26906,32 +26909,38 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
26906
26909
|
port = (_c = devLocalConfig.port) !== null && _c !== void 0 ? _c : 3000;
|
|
26907
26910
|
host = "localhost:" + port.toString();
|
|
26908
26911
|
url = "http://" + host;
|
|
26909
|
-
predefinedVariables = __assign(__assign({}, basePredefinedVariables), {
|
|
26912
|
+
predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), {
|
|
26910
26913
|
ENV_SHORT: "local",
|
|
26911
|
-
ROOT_URL: url
|
|
26912
|
-
|
|
26913
|
-
|
|
26914
|
+
ROOT_URL: url
|
|
26915
|
+
}), (0, types_1.isStandaloneBuildConfig)(buildConfigRaw) && buildConfigRaw.type === "rails" ? {} : {
|
|
26916
|
+
HOST: host
|
|
26917
|
+
}), {
|
|
26918
|
+
HOST_INTERNAL: host,
|
|
26914
26919
|
ROOT_URL_INTERNAL: "http://" + host,
|
|
26915
26920
|
PORT: port.toString()
|
|
26916
26921
|
});
|
|
26917
26922
|
} else {
|
|
26918
26923
|
additionalEnvVars = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext) : {};
|
|
26919
|
-
|
|
26920
|
-
host = (_e = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _e !== void 0 ? _e :
|
|
26924
|
+
HOST_INTERNAL = (_d = additionalEnvVars.HOST_INTERNAL) !== null && _d !== void 0 ? _d : "unknown-host.example.com";
|
|
26925
|
+
host = (_e = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _e !== void 0 ? _e : HOST_INTERNAL;
|
|
26921
26926
|
url = (0, BashExpression_1.joinBashExpressions)(["https://", host]);
|
|
26922
26927
|
predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), (0, types_1.isStandaloneBuildConfig)(buildConfigRaw) && buildConfigRaw.type === "rails" ? {} : {
|
|
26923
|
-
|
|
26928
|
+
HOST: host
|
|
26924
26929
|
}), {
|
|
26925
26930
|
ROOT_URL: url,
|
|
26926
|
-
|
|
26927
|
-
|
|
26931
|
+
HOST_INTERNAL: HOST_INTERNAL,
|
|
26932
|
+
/**@deprecated */
|
|
26933
|
+
HOST_CANONICAL: HOST_INTERNAL,
|
|
26934
|
+
ROOT_URL_INTERNAL: (0, BashExpression_1.joinBashExpressions)(["https://", HOST_INTERNAL])
|
|
26928
26935
|
}), additionalEnvVars);
|
|
26929
26936
|
}
|
|
26930
26937
|
publicEnvVarsRaw = (_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.public) !== null && _g !== void 0 ? _g : {};
|
|
26931
26938
|
additionalSecretKeys = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].additionalSecretKeys(environmentContext) : [];
|
|
26932
26939
|
secretEnvVarKeys = __spreadArray(__spreadArray([], __read((0, envVars_1.stringListToSecreteEnvVarList)((_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.secret) !== null && _j !== void 0 ? _j : [])), false), __read(additionalSecretKeys), false);
|
|
26933
26940
|
secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
|
|
26934
|
-
|
|
26941
|
+
legacyFromComponents = (_l = (_k = envConfigRaw.vars) === null || _k === void 0 ? void 0 : _k.fromComponents) !== null && _l !== void 0 ? _l : {};
|
|
26942
|
+
publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
|
|
26943
|
+
publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
|
|
26935
26944
|
envVarsRaw = addIndexVar(__assign(__assign(__assign({}, predefinedVariables), secretEnvVars), publicEnvVarsRawSanitized));
|
|
26936
26945
|
return [4 /*yield*/, (0, resolveReferences_1.resolveReferences)(envVarsRaw, function (otherComponentName, alreadyVisited) {
|
|
26937
26946
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -26950,7 +26959,7 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
26950
26959
|
});
|
|
26951
26960
|
}, alreadyVisited)];
|
|
26952
26961
|
case 1:
|
|
26953
|
-
envVars =
|
|
26962
|
+
envVars = _m.sent();
|
|
26954
26963
|
_a = {
|
|
26955
26964
|
envVars: envVars,
|
|
26956
26965
|
secretEnvVarKeys: secretEnvVarKeys
|
|
@@ -26958,10 +26967,10 @@ var getEnvironmentVariables = function (ctx_1) {
|
|
|
26958
26967
|
_b = {};
|
|
26959
26968
|
return [4 /*yield*/, (0, transformJobOnlyVars_1.transformJobOnlyVars)(env, componentName, buildConfigRaw && (0, types_1.isStandaloneBuildConfig)(buildConfigRaw) && buildConfigRaw.jobVars || null)];
|
|
26960
26969
|
case 2:
|
|
26961
|
-
_b.build =
|
|
26970
|
+
_b.build = _m.sent();
|
|
26962
26971
|
return [4 /*yield*/, (0, transformJobOnlyVars_1.transformJobOnlyVars)(env, componentName, deployConfigRaw && deployConfigRaw.jobVars || null)];
|
|
26963
26972
|
case 3:
|
|
26964
|
-
return [2 /*return*/, (_a.jobOnlyVars = (_b.deploy =
|
|
26973
|
+
return [2 /*return*/, (_a.jobOnlyVars = (_b.deploy = _m.sent(), _b), _a.host = host, _a.url = url, _a)];
|
|
26965
26974
|
}
|
|
26966
26975
|
});
|
|
26967
26976
|
});
|
|
@@ -27257,7 +27266,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
27257
27266
|
Object.defineProperty(exports, "__esModule", ({
|
|
27258
27267
|
value: true
|
|
27259
27268
|
}));
|
|
27260
|
-
exports.resolveReferences = void 0;
|
|
27269
|
+
exports.translateLegacyFromComponents = exports.resolveReferences = void 0;
|
|
27261
27270
|
var lodash_1 = __nccwpck_require__(3255);
|
|
27262
27271
|
var replaceAsync_1 = __importDefault(__nccwpck_require__(1686));
|
|
27263
27272
|
// regex to resolve references in catladder variables
|
|
@@ -27373,6 +27382,20 @@ var resolveReferences = function (vars_1, getOtherVariables_1) {
|
|
|
27373
27382
|
});
|
|
27374
27383
|
};
|
|
27375
27384
|
exports.resolveReferences = resolveReferences;
|
|
27385
|
+
var translateLegacyFromComponents = function (fromComponents) {
|
|
27386
|
+
return Object.fromEntries(Object.entries(fromComponents).flatMap(function (_a) {
|
|
27387
|
+
var _b = __read(_a, 2),
|
|
27388
|
+
componentName = _b[0],
|
|
27389
|
+
variables = _b[1];
|
|
27390
|
+
return Object.entries(variables).map(function (_a) {
|
|
27391
|
+
var _b = __read(_a, 2),
|
|
27392
|
+
ourName = _b[0],
|
|
27393
|
+
otherName = _b[1];
|
|
27394
|
+
return [ourName, "${" + componentName + ":" + otherName + "}"];
|
|
27395
|
+
});
|
|
27396
|
+
}));
|
|
27397
|
+
};
|
|
27398
|
+
exports.translateLegacyFromComponents = translateLegacyFromComponents;
|
|
27376
27399
|
|
|
27377
27400
|
/***/ }),
|
|
27378
27401
|
|
|
@@ -27684,7 +27707,7 @@ var stop_1 = __nccwpck_require__(7974);
|
|
|
27684
27707
|
var variables_1 = __nccwpck_require__(7119);
|
|
27685
27708
|
exports.DEPLOY_JOB_NAME = "🚀 Deploy";
|
|
27686
27709
|
var createDeployJob = function (context, jobDefinition) {
|
|
27687
|
-
var _a, _b, _c, _d, _e, _f;
|
|
27710
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
27688
27711
|
var hasDocker = (0, docker_1.requiresDockerBuild)(context);
|
|
27689
27712
|
var isStoppable = (0, utils_1.contextIsStoppable)(context);
|
|
27690
27713
|
var autoStop = context.environment.envType === "review" ? "1 week" : context.environment.envType === "dev" ? "4 weeks" : undefined;
|
|
@@ -27739,8 +27762,8 @@ var createDeployJob = function (context, jobDefinition) {
|
|
|
27739
27762
|
when: whenDeploy === "auto" ? "on_success" : "manual",
|
|
27740
27763
|
allow_failure: whenDeploy === "manual" ? true : false,
|
|
27741
27764
|
stage: "deploy",
|
|
27742
|
-
variables: __assign(__assign(__assign(__assign({}, context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.environment.jobOnlyVars.deploy.envVars), jobDefinition.variables),
|
|
27743
|
-
runnerVariables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), (
|
|
27765
|
+
variables: __assign(__assign(__assign(__assign(__assign({}, context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.environment.jobOnlyVars.deploy.envVars), deployConfig ? (_e = deployConfig.extraVars) !== null && _e !== void 0 ? _e : {} : {}), jobDefinition.variables),
|
|
27766
|
+
runnerVariables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), (_f = jobDefinition.runnerVariables) !== null && _f !== void 0 ? _f : {}), deployConfig ? (_g = deployConfig.runnerVariables) !== null && _g !== void 0 ? _g : {} : {}),
|
|
27744
27767
|
environment: isStoppable ? {
|
|
27745
27768
|
on_stop: stop_1.STOP_JOB_NAME,
|
|
27746
27769
|
auto_stop_in: autoStop
|
|
@@ -28970,7 +28993,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
28970
28993
|
env = ctx.env,
|
|
28971
28994
|
componentName = ctx.componentName,
|
|
28972
28995
|
deployConfigRaw = ctx.deployConfigRaw;
|
|
28973
|
-
var
|
|
28996
|
+
var HOST_INTERNAL = (0, BashExpression_1.joinBashExpressions)([fullName, (0, BashExpression_1.getBashVariable)((0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX))], "-").toLowerCase();
|
|
28974
28997
|
var jobTriggers = deployConfigRaw && deployConfigRaw.jobs ? Object.fromEntries(Object.entries(deployConfigRaw.jobs).map(function (_a) {
|
|
28975
28998
|
var _b = __read(_a, 2),
|
|
28976
28999
|
name = _b[0],
|
|
@@ -28978,7 +29001,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
28978
29001
|
return ["CLOUD_RUN_JOB_TRIGGER_URL_" + (0, gitlab_1.sanitizeForBashVariable)(name), "https://".concat(deployConfigRaw.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfigRaw.projectId, "/jobs/").concat((0, jobName_1.getCloudRunJobName)(fullName, name), ":run")];
|
|
28979
29002
|
})) : {};
|
|
28980
29003
|
return __assign(__assign(__assign({
|
|
28981
|
-
|
|
29004
|
+
HOST_INTERNAL: HOST_INTERNAL
|
|
28982
29005
|
}, getCloudSqlVariables(ctx)), jobTriggers), {
|
|
28983
29006
|
DEPLOY_CLOUD_RUN_PROJECT_ID: deployConfigRaw ? deployConfigRaw.projectId : undefined,
|
|
28984
29007
|
DEPLOY_CLOUD_RUN_REGION: deployConfigRaw ? deployConfigRaw.region : undefined
|
|
@@ -29546,7 +29569,7 @@ var hasKubernetesCloudSQL = function (context) {
|
|
|
29546
29569
|
};
|
|
29547
29570
|
exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
|
|
29548
29571
|
var createKubernetesCloudsqlBaseValues = function (context) {
|
|
29549
|
-
var _a, _b, _c;
|
|
29572
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
29550
29573
|
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
29551
29574
|
if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
29552
29575
|
throw new Error("cannot get cloud sql config");
|
|
@@ -29556,11 +29579,22 @@ var createKubernetesCloudsqlBaseValues = function (context) {
|
|
|
29556
29579
|
throw new Error("cannot get cloud sql config");
|
|
29557
29580
|
}
|
|
29558
29581
|
var proxyCredentials = "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"));
|
|
29559
|
-
if (config.type
|
|
29582
|
+
if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
|
|
29583
|
+
var instanceConnectionName = "".concat((_c = config.projectId) !== null && _c !== void 0 ? _c : "skynet-164509", ":").concat((_d = config.region) !== null && _d !== void 0 ? _d : "europe-west6", ":").concat((_e = config.instanceId) !== null && _e !== void 0 ? _e : context.environment.envVars.KUBE_NAMESPACE);
|
|
29584
|
+
return {
|
|
29585
|
+
cloudsql: {
|
|
29586
|
+
enabled: config.enabled,
|
|
29587
|
+
dbUser: "postgres",
|
|
29588
|
+
instanceConnectionName: instanceConnectionName,
|
|
29589
|
+
proxyCredentials: proxyCredentials,
|
|
29590
|
+
fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : ""
|
|
29591
|
+
}
|
|
29592
|
+
};
|
|
29593
|
+
} else if (config.type === "unmanaged") {
|
|
29560
29594
|
return {
|
|
29561
29595
|
cloudsql: {
|
|
29562
29596
|
enabled: config.enabled,
|
|
29563
|
-
dbUser: (
|
|
29597
|
+
dbUser: (_g = config.dbUser) !== null && _g !== void 0 ? _g : "postgres",
|
|
29564
29598
|
instanceConnectionName: config.instanceConnectionName,
|
|
29565
29599
|
proxyCredentials: proxyCredentials,
|
|
29566
29600
|
fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.name)
|
|
@@ -29657,7 +29691,9 @@ var createKubernetesDeployJobs = function (context) {
|
|
|
29657
29691
|
KUBE_DOCKER_IMAGE_PULL_SECRET: "gitlab-registry-".concat(context.name),
|
|
29658
29692
|
HELM_GITLAB_CHART_NAME: (_b = deployConfig.chartName) !== null && _b !== void 0 ? _b : "/helm-charts/the-panter-chart",
|
|
29659
29693
|
HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : []), false).join(" "),
|
|
29660
|
-
COMPONENT_NAME: context.name
|
|
29694
|
+
COMPONENT_NAME: context.name,
|
|
29695
|
+
/** @deprecated */
|
|
29696
|
+
BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID
|
|
29661
29697
|
})
|
|
29662
29698
|
});
|
|
29663
29699
|
var clusterName = "kube-".concat(context.environment.fullName);
|
|
@@ -29770,12 +29806,12 @@ exports.KUBERNETES_DEPLOY_TYPE = {
|
|
|
29770
29806
|
var domainCanonical = deployConfigRaw && ((_b = deployConfigRaw.cluster) === null || _b === void 0 ? void 0 : _b.domainCanonical) ||
|
|
29771
29807
|
// 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
|
|
29772
29808
|
fullConfig.domainCanonical || "panter.cloud";
|
|
29773
|
-
var
|
|
29809
|
+
var HOST_INTERNAL = (0, BashExpression_1.joinBashExpressions)(__spreadArray(__spreadArray([componentSlug], __read(envType === "review" && reviewSlug ? [reviewSlug] : []), false), [env, fullConfig.appName, fullConfig.customerName, domainCanonical], false), "."); // default for kubernetes and rest
|
|
29774
29810
|
return {
|
|
29775
29811
|
KUBE_NAMESPACE: KUBE_NAMESPACE,
|
|
29776
29812
|
KUBE_APP_NAME: KUBE_APP_NAME,
|
|
29777
29813
|
KUBE_APP_NAME_PREFIX: KUBE_APP_NAME_PREFIX,
|
|
29778
|
-
|
|
29814
|
+
HOST_INTERNAL: HOST_INTERNAL
|
|
29779
29815
|
};
|
|
29780
29816
|
}
|
|
29781
29817
|
};
|
|
@@ -29921,6 +29957,7 @@ var types_1 = __nccwpck_require__(4436);
|
|
|
29921
29957
|
var cloudSql_1 = __nccwpck_require__(442);
|
|
29922
29958
|
var kubeEnv_1 = __nccwpck_require__(5296);
|
|
29923
29959
|
var mongodb_1 = __nccwpck_require__(221);
|
|
29960
|
+
var processSecretsAsFiles_1 = __nccwpck_require__(5088);
|
|
29924
29961
|
var createAppConfig = function (context, application) {
|
|
29925
29962
|
if (application === false) {
|
|
29926
29963
|
return {
|
|
@@ -29984,10 +30021,10 @@ var createKubeValues = function (context) {
|
|
|
29984
30021
|
env: env,
|
|
29985
30022
|
application: createAppConfig(context, application)
|
|
29986
30023
|
}, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(context) : {}, ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
|
|
29987
|
-
var kubeValues = (0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
30024
|
+
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
29988
30025
|
jobs: removeFalsy(jobs),
|
|
29989
30026
|
cronjobs: removeFalsy(cronjobs)
|
|
29990
|
-
}, rest));
|
|
30027
|
+
}, rest)));
|
|
29991
30028
|
return kubeValues;
|
|
29992
30029
|
};
|
|
29993
30030
|
exports.createKubeValues = createKubeValues;
|
|
@@ -30113,6 +30150,46 @@ exports.createMongodbBaseConfig = createMongodbBaseConfig;
|
|
|
30113
30150
|
|
|
30114
30151
|
/***/ }),
|
|
30115
30152
|
|
|
30153
|
+
/***/ 5088:
|
|
30154
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
30155
|
+
|
|
30156
|
+
"use strict";
|
|
30157
|
+
|
|
30158
|
+
|
|
30159
|
+
var __assign = this && this.__assign || function () {
|
|
30160
|
+
__assign = Object.assign || function (t) {
|
|
30161
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
30162
|
+
s = arguments[i];
|
|
30163
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
30164
|
+
}
|
|
30165
|
+
return t;
|
|
30166
|
+
};
|
|
30167
|
+
return __assign.apply(this, arguments);
|
|
30168
|
+
};
|
|
30169
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
30170
|
+
value: true
|
|
30171
|
+
}));
|
|
30172
|
+
exports.processSecretsAsFiles = void 0;
|
|
30173
|
+
var lodash_1 = __nccwpck_require__(3255);
|
|
30174
|
+
var processSecretsAsFiles = function (values) {
|
|
30175
|
+
if (!values.secretsAsFile || values.secretsAsFile.length === 0) {
|
|
30176
|
+
return values;
|
|
30177
|
+
}
|
|
30178
|
+
// the initial idea was that we "shadow" secrets that we mount as files,
|
|
30179
|
+
// but there is a weird kubernetes issue with that (https://github.com/kubernetes/kubernetes/issues/46861),
|
|
30180
|
+
// 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
|
|
30181
|
+
return __assign(__assign({}, values), {
|
|
30182
|
+
env: __assign(__assign({}, values.env), {
|
|
30183
|
+
secret: __assign(__assign({}, (0, lodash_1.omit)(values.env.secret, values.secretsAsFile)), Object.fromEntries(values.secretsAsFile.map(function (key) {
|
|
30184
|
+
return [key + "_content", values.env.secret[key]];
|
|
30185
|
+
})))
|
|
30186
|
+
})
|
|
30187
|
+
});
|
|
30188
|
+
};
|
|
30189
|
+
exports.processSecretsAsFiles = processSecretsAsFiles;
|
|
30190
|
+
|
|
30191
|
+
/***/ }),
|
|
30192
|
+
|
|
30116
30193
|
/***/ 1634:
|
|
30117
30194
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
30118
30195
|
|
|
@@ -31685,6 +31762,7 @@ var makeGitlabJob = function (context, job, allJobs, baseRules) {
|
|
|
31685
31762
|
var environment = job.environment,
|
|
31686
31763
|
envMode = job.envMode,
|
|
31687
31764
|
needsStages = job.needsStages,
|
|
31765
|
+
needsOtherComponent = job.needsOtherComponent,
|
|
31688
31766
|
name = job.name,
|
|
31689
31767
|
needs = job.needs,
|
|
31690
31768
|
jobTags = job.jobTags,
|
|
@@ -31692,7 +31770,7 @@ var makeGitlabJob = function (context, job, allJobs, baseRules) {
|
|
|
31692
31770
|
variables = job.variables,
|
|
31693
31771
|
runnerVariables = job.runnerVariables,
|
|
31694
31772
|
when = job.when,
|
|
31695
|
-
rest = __rest(job, ["environment", "envMode", "needsStages", "name", "needs", "jobTags", "script", "variables", "runnerVariables", "when"]);
|
|
31773
|
+
rest = __rest(job, ["environment", "envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags", "script", "variables", "runnerVariables", "when"]);
|
|
31696
31774
|
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(context.env) : job.stage;
|
|
31697
31775
|
var deduplicatedGitlabNeeds = getGitlabNeeds(context, job, allJobs);
|
|
31698
31776
|
var fullJobName = getFullJobName({
|
|
@@ -31813,7 +31891,8 @@ function deduplicateNeeds(needs) {
|
|
|
31813
31891
|
}
|
|
31814
31892
|
function getGitlabNeedsForComponentJob(context, _a, allJobs) {
|
|
31815
31893
|
var needsStages = _a.needsStages,
|
|
31816
|
-
needs = _a.needs
|
|
31894
|
+
needs = _a.needs,
|
|
31895
|
+
needsOtherComponent = _a.needsOtherComponent;
|
|
31817
31896
|
var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
|
|
31818
31897
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
31819
31898
|
var componentName = context.name;
|
|
@@ -31855,7 +31934,7 @@ function getGitlabNeedsForComponentJob(context, _a, allJobs) {
|
|
|
31855
31934
|
});
|
|
31856
31935
|
}
|
|
31857
31936
|
});
|
|
31858
|
-
var cleanedNeeds = __spreadArray(__spreadArray([], __read(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []), false), __read(needs !== null && needs !== void 0 ? needs : []), false);
|
|
31937
|
+
var cleanedNeeds = __spreadArray(__spreadArray(__spreadArray([], __read(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []), false), __read(needs !== null && needs !== void 0 ? needs : []), false), __read(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []), false);
|
|
31859
31938
|
return cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
|
|
31860
31939
|
var _a;
|
|
31861
31940
|
return (0, lodash_1.isObject)(n) ? "workspaceName" in n ? {
|
package/dist/constants.js
CHANGED
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
7
|
-
exports.PIPELINE_IMAGE_TAG = "next-
|
|
7
|
+
exports.PIPELINE_IMAGE_TAG = "next-e2e4f00a" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|
|
@@ -343,4 +343,26 @@ describe("resolveReferences", function () {
|
|
|
343
343
|
});
|
|
344
344
|
});
|
|
345
345
|
});
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
describe("translateLegacyFromComponents", function () {
|
|
349
|
+
it("translatetes the old `fromComponents` approach to ${componentName:variableName}", function () {
|
|
350
|
+
var fromComponents = {
|
|
351
|
+
api: {
|
|
352
|
+
API_FOO: "FOO",
|
|
353
|
+
API_BAR: "BAR"
|
|
354
|
+
},
|
|
355
|
+
www: {
|
|
356
|
+
WWW_X: "X",
|
|
357
|
+
WWW_Y: "Y"
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
var result = (0, resolveReferences_1.translateLegacyFromComponents)(fromComponents);
|
|
361
|
+
expect(result).toEqual({
|
|
362
|
+
API_FOO: "${api:FOO}",
|
|
363
|
+
API_BAR: "${api:BAR}",
|
|
364
|
+
WWW_X: "${www:X}",
|
|
365
|
+
WWW_Y: "${www:Y}"
|
|
366
|
+
});
|
|
367
|
+
});
|
|
346
368
|
});
|
|
@@ -148,7 +148,8 @@ var getEnvironment = function (ctx) {
|
|
|
148
148
|
fullName: envContext.fullName,
|
|
149
149
|
slugPrefix: envContext.environmentSlugPrefix,
|
|
150
150
|
reviewSlug: envContext.reviewSlug,
|
|
151
|
-
slug: envContext.environmentSlug
|
|
151
|
+
slug: envContext.environmentSlug,
|
|
152
|
+
shortName: env
|
|
152
153
|
}, variables)];
|
|
153
154
|
}
|
|
154
155
|
});
|
|
@@ -13,9 +13,12 @@ declare const getBasePredefinedVariables: (ctx: EnvironmentContext) => {
|
|
|
13
13
|
};
|
|
14
14
|
type BasePredefinedVariables = ReturnType<typeof getBasePredefinedVariables>;
|
|
15
15
|
export type PredefinedVariables = BasePredefinedVariables & {
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* undefined in rails, Rails before 6.1 (mis)uses the `HOST` environment variable to specify the IP to bind to
|
|
18
|
+
*/
|
|
19
|
+
HOST?: StringOrBashExpression;
|
|
17
20
|
ROOT_URL: StringOrBashExpression;
|
|
18
|
-
|
|
21
|
+
HOST_INTERNAL: StringOrBashExpression;
|
|
19
22
|
ROOT_URL_INTERNAL: StringOrBashExpression;
|
|
20
23
|
};
|
|
21
24
|
export declare const getEnvironmentVariables: (ctx: CreateComponentContextContext, alreadyVisited?: Record<string, Record<string, boolean>>) => Promise<EnvironmentVariables>;
|