@catladder/pipeline 1.146.1 → 1.147.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/build/base/createAppBuildJob.d.ts +2 -2
- package/dist/build/base/createAppBuildJob.js +6 -6
- package/dist/build/base/index.d.ts +2 -2
- package/dist/build/base/writeBuildInfo.d.ts +2 -2
- package/dist/build/base/writeBuildInfo.js +1 -1
- package/dist/build/base/writeDotEnv.d.ts +2 -2
- package/dist/build/base/writeDotEnv.js +1 -1
- package/dist/build/custom/__tests__/testJob.test.js +11 -14
- package/dist/build/custom/buildJob.d.ts +2 -2
- package/dist/build/custom/buildJob.js +5 -5
- package/dist/build/custom/index.d.ts +2 -2
- package/dist/build/custom/testJob.d.ts +2 -2
- package/dist/build/custom/testJob.js +5 -5
- package/dist/build/docker.d.ts +32 -15
- package/dist/build/docker.js +41 -20
- package/dist/build/index.d.ts +2 -2
- package/dist/build/node/buildJob.d.ts +2 -2
- package/dist/build/node/buildJob.js +8 -8
- package/dist/build/node/cache.d.ts +5 -5
- package/dist/build/node/cache.js +5 -5
- package/dist/build/node/index.d.ts +4 -4
- package/dist/build/node/meteor.d.ts +2 -2
- package/dist/build/node/meteor.js +6 -6
- package/dist/build/node/testJob.d.ts +2 -2
- package/dist/build/node/testJob.js +11 -11
- package/dist/build/node/yarn.d.ts +4 -4
- package/dist/build/node/yarn.js +1 -1
- package/dist/build/rails/build.d.ts +2 -2
- package/dist/build/rails/build.js +3 -3
- package/dist/build/rails/index.d.ts +2 -2
- package/dist/build/rails/test.d.ts +2 -2
- package/dist/build/rails/test.js +4 -4
- package/dist/build/sbom.d.ts +2 -2
- package/dist/build/sbom.js +2 -2
- package/dist/build/types.d.ts +34 -26
- package/dist/bundles/catladder-gitlab/index.js +2 -2
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironment.d.ts +2 -2
- package/dist/context/getEnvironmentContext.d.ts +2 -2
- package/dist/context/getEnvironmentVariables.d.ts +4 -4
- package/dist/context/getLabels.d.ts +2 -2
- package/dist/context/getLabels.js +1 -1
- package/dist/context/index.d.ts +7 -3
- package/dist/context/index.js +43 -12
- package/dist/deploy/base/deploy.d.ts +2 -2
- package/dist/deploy/base/deploy.js +9 -8
- package/dist/deploy/base/index.d.ts +2 -2
- package/dist/deploy/base/rollback.d.ts +2 -2
- package/dist/deploy/base/stop.d.ts +2 -2
- package/dist/deploy/cloudRun/artifactsRegistry.d.ts +7 -11
- package/dist/deploy/cloudRun/artifactsRegistry.js +8 -9
- package/dist/deploy/cloudRun/cleanup.d.ts +2 -2
- package/dist/deploy/cloudRun/cloudRunRevisions.d.ts +2 -2
- package/dist/deploy/cloudRun/cloudRunRevisions.js +4 -5
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +6 -6
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.d.ts +3 -3
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +1 -1
- package/dist/deploy/cloudRun/createJobs/common.js +2 -1
- package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +2 -2
- package/dist/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +2 -2
- package/dist/deploy/cloudRun/createJobs/index.d.ts +2 -2
- package/dist/deploy/cloudRun/createJobs/index.js +2 -4
- package/dist/deploy/cloudRun/utils/database.d.ts +3 -3
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -2
- package/dist/deploy/cloudRun/utils/getServiceName.d.ts +2 -2
- package/dist/deploy/custom/deployJob.d.ts +2 -2
- package/dist/deploy/custom/deployJob.js +7 -10
- package/dist/deploy/dockerTag/deployJob.d.ts +2 -2
- package/dist/deploy/dockerTag/deployJob.js +3 -5
- package/dist/deploy/index.d.ts +2 -2
- package/dist/deploy/kubernetes/cloudSql/index.d.ts +3 -3
- package/dist/deploy/kubernetes/cloudSql/index.js +11 -9
- package/dist/deploy/kubernetes/deployJob.d.ts +2 -2
- package/dist/deploy/kubernetes/deployJob.js +4 -7
- package/dist/deploy/kubernetes/kubeEnv.d.ts +2 -2
- package/dist/deploy/kubernetes/kubeEnv.js +2 -1
- package/dist/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/deploy/kubernetes/kubeValues.js +10 -10
- package/dist/deploy/kubernetes/mongodb.d.ts +2 -2
- package/dist/deploy/kubernetes/mongodb.js +11 -11
- package/dist/deploy/sbom.d.ts +4 -4
- package/dist/deploy/sbom.js +1 -1
- package/dist/deploy/types/index.d.ts +1 -1
- package/dist/deploy/types/index.js +1 -1
- package/dist/deploy/utils.d.ts +2 -2
- package/dist/deploy/utils.js +2 -1
- package/dist/pipeline/createJobsForComponent.d.ts +2 -2
- package/dist/pipeline/createJobsForComponent.js +6 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +2 -2
- package/dist/types/context.d.ts +28 -2
- package/examples/__snapshots__/cloud-run-storybook.ts.snap +1687 -0
- package/examples/__snapshots__/cloud-run-with-ngnix.ts.snap +1971 -0
- package/examples/cloud-run-storybook.ts +24 -0
- package/examples/cloud-run-with-ngnix.ts +24 -0
- package/package.json +1 -1
- package/src/build/base/createAppBuildJob.ts +9 -9
- package/src/build/base/index.ts +2 -2
- package/src/build/base/writeBuildInfo.ts +3 -3
- package/src/build/base/writeDotEnv.ts +3 -3
- package/src/build/custom/__tests__/testJob.test.ts +8 -11
- package/src/build/custom/buildJob.ts +10 -11
- package/src/build/custom/index.ts +2 -2
- package/src/build/custom/testJob.ts +9 -7
- package/src/build/docker.ts +73 -29
- package/src/build/index.ts +2 -2
- package/src/build/node/buildJob.ts +19 -15
- package/src/build/node/cache.ts +10 -10
- package/src/build/node/index.ts +6 -4
- package/src/build/node/meteor.ts +16 -17
- package/src/build/node/testJob.ts +19 -16
- package/src/build/node/yarn.ts +6 -8
- package/src/build/rails/build.ts +7 -5
- package/src/build/rails/index.ts +2 -2
- package/src/build/rails/test.ts +8 -6
- package/src/build/sbom.ts +5 -5
- package/src/build/types.ts +53 -38
- package/src/context/getEnvironment.ts +2 -2
- package/src/context/getEnvironmentContext.ts +2 -2
- package/src/context/getEnvironmentVariables.ts +7 -4
- package/src/context/getLabels.ts +3 -3
- package/src/context/index.ts +33 -7
- package/src/deploy/base/deploy.ts +10 -16
- package/src/deploy/base/index.ts +2 -2
- package/src/deploy/base/rollback.ts +2 -2
- package/src/deploy/base/stop.ts +2 -2
- package/src/deploy/cloudRun/artifactsRegistry.ts +16 -16
- package/src/deploy/cloudRun/cleanup.ts +2 -2
- package/src/deploy/cloudRun/cloudRunRevisions.ts +6 -8
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +10 -10
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +4 -4
- package/src/deploy/cloudRun/createJobs/common.ts +1 -1
- package/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts +5 -2
- package/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.ts +2 -2
- package/src/deploy/cloudRun/createJobs/index.ts +3 -6
- package/src/deploy/cloudRun/utils/database.ts +3 -3
- package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +4 -2
- package/src/deploy/cloudRun/utils/getServiceName.ts +2 -2
- package/src/deploy/custom/deployJob.ts +10 -8
- package/src/deploy/dockerTag/deployJob.ts +6 -7
- package/src/deploy/index.ts +2 -2
- package/src/deploy/kubernetes/cloudSql/index.ts +10 -7
- package/src/deploy/kubernetes/deployJob.ts +3 -6
- package/src/deploy/kubernetes/kubeEnv.ts +3 -3
- package/src/deploy/kubernetes/kubeValues.ts +6 -6
- package/src/deploy/kubernetes/mongodb.ts +14 -14
- package/src/deploy/sbom.ts +9 -6
- package/src/deploy/types/index.ts +2 -2
- package/src/deploy/utils.ts +3 -3
- package/src/pipeline/createJobsForComponent.ts +17 -17
- package/src/pipeline/gitlab/createGitlabJobs.ts +2 -2
- package/src/types/config.ts +4 -2
- package/src/types/context.ts +33 -2
|
@@ -8,39 +8,41 @@ var context_1 = require("../../../context");
|
|
|
8
8
|
var utils_1 = require("../../cloudSql/utils");
|
|
9
9
|
var types_1 = require("../../types");
|
|
10
10
|
var hasKubernetesCloudSQL = function (context) {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
13
|
+
if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
14
|
+
return (_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.cloudsql) === null || _c === void 0 ? void 0 : _c.enabled;
|
|
14
15
|
}
|
|
15
16
|
return false;
|
|
16
17
|
};
|
|
17
18
|
exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
|
|
18
19
|
var createKubernetesCloudsqlBaseValues = function (context) {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f;
|
|
20
|
-
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
21
|
+
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
22
|
+
if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
21
23
|
throw new Error("cannot get cloud sql config");
|
|
22
24
|
}
|
|
23
|
-
var config = (
|
|
25
|
+
var config = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.cloudsql;
|
|
24
26
|
if (!config) {
|
|
25
27
|
throw new Error("cannot get cloud sql config");
|
|
26
28
|
}
|
|
27
29
|
var proxyCredentials = "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"));
|
|
28
30
|
if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
|
|
29
|
-
var instanceConnectionName = "".concat((
|
|
31
|
+
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);
|
|
30
32
|
return {
|
|
31
33
|
cloudsql: {
|
|
32
34
|
enabled: config.enabled,
|
|
33
35
|
dbUser: "postgres",
|
|
34
36
|
instanceConnectionName: instanceConnectionName,
|
|
35
37
|
proxyCredentials: proxyCredentials,
|
|
36
|
-
fullDbName: (
|
|
38
|
+
fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : ""
|
|
37
39
|
}
|
|
38
40
|
};
|
|
39
41
|
} else if (config.type === "unmanaged") {
|
|
40
42
|
return {
|
|
41
43
|
cloudsql: {
|
|
42
44
|
enabled: config.enabled,
|
|
43
|
-
dbUser: (
|
|
45
|
+
dbUser: (_g = config.dbUser) !== null && _g !== void 0 ? _g : "postgres",
|
|
44
46
|
instanceConnectionName: config.instanceConnectionName,
|
|
45
47
|
proxyCredentials: proxyCredentials,
|
|
46
48
|
fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.componentName)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
export declare const createKubernetesDeployJobs: (context:
|
|
3
|
+
export declare const createKubernetesDeployJobs: (context: ComponentContext) => CatladderJob[];
|
|
@@ -55,11 +55,8 @@ var bashYaml_1 = require("../../bash/bashYaml");
|
|
|
55
55
|
var gitlab_1 = require("../../utils/gitlab");
|
|
56
56
|
var ALL_VALUES_FILE = "__all_values.yml";
|
|
57
57
|
var createKubernetesDeployJobs = function (context) {
|
|
58
|
-
var _a, _b;
|
|
59
|
-
var deployConfig = context.
|
|
60
|
-
if (deployConfig === false) {
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
58
|
+
var _a, _b, _c;
|
|
59
|
+
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
63
60
|
if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
64
61
|
// should not happen
|
|
65
62
|
throw new Error("deploy config is not kubernetes");
|
|
@@ -78,8 +75,8 @@ var createKubernetesDeployJobs = function (context) {
|
|
|
78
75
|
RELEASE_NAME: context.environment.fullName,
|
|
79
76
|
HELM_EXPERIMENTAL_OCI: "1",
|
|
80
77
|
KUBE_DOCKER_IMAGE_PULL_SECRET: "gitlab-registry-".concat(context.componentName),
|
|
81
|
-
HELM_GITLAB_CHART_NAME: (
|
|
82
|
-
HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((
|
|
78
|
+
HELM_GITLAB_CHART_NAME: (_b = deployConfig.chartName) !== null && _b !== void 0 ? _b : "/helm-charts/the-panter-chart",
|
|
79
|
+
HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : []), false).join(" "),
|
|
83
80
|
COMPONENT_NAME: context.componentName,
|
|
84
81
|
/** @deprecated */
|
|
85
82
|
BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { StringOrBashExpression } from "../../bash/BashExpression";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentContext } from "../../types";
|
|
3
3
|
/**
|
|
4
4
|
* separate by secrets and public.
|
|
5
5
|
* we evalulate the actual values later, but want to store the secrets in kubernetes secrets
|
|
6
6
|
*/
|
|
7
|
-
export declare const createKubeEnv: (context:
|
|
7
|
+
export declare const createKubeEnv: (context: ComponentContext) => {
|
|
8
8
|
secret: Record<string, StringOrBashExpression>;
|
|
9
9
|
public: Record<string, StringOrBashExpression>;
|
|
10
10
|
};
|
|
@@ -50,7 +50,8 @@ var shouldGoIntoSecrets = function (key, value) {
|
|
|
50
50
|
* we evalulate the actual values later, but want to store the secrets in kubernetes secrets
|
|
51
51
|
*/
|
|
52
52
|
var createKubeEnv = function (context) {
|
|
53
|
-
|
|
53
|
+
var _a;
|
|
54
|
+
if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
|
|
54
55
|
// should not happen
|
|
55
56
|
throw new Error("deploy config is not kubernetes");
|
|
56
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const createKubeValues: (context:
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
export declare const createKubeValues: (context: ComponentContext) => never[] | ({
|
|
3
3
|
env: {
|
|
4
4
|
secret: Record<string, import("../../bash/BashExpression").StringOrBashExpression>;
|
|
5
5
|
public: Record<string, import("../../bash/BashExpression").StringOrBashExpression>;
|
|
@@ -63,7 +63,7 @@ var createAppConfig = function (context, application) {
|
|
|
63
63
|
rest = __rest(_a, ["healthRoute", "command"]);
|
|
64
64
|
return (0, utils_1.mergeWithMergingArrays)({
|
|
65
65
|
host: context.environment.host,
|
|
66
|
-
command: command !== null && command !== void 0 ? command : context.
|
|
66
|
+
command: command !== null && command !== void 0 ? command : context.build.config.startCommand,
|
|
67
67
|
livenessProbe: {
|
|
68
68
|
httpGet: {
|
|
69
69
|
path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
|
|
@@ -92,9 +92,9 @@ var removeFalsy = function (record) {
|
|
|
92
92
|
}));
|
|
93
93
|
};
|
|
94
94
|
var createKubeValues = function (context) {
|
|
95
|
-
var _a, _b;
|
|
96
|
-
var deployConfig = context.
|
|
97
|
-
if (deployConfig
|
|
95
|
+
var _a, _b, _c;
|
|
96
|
+
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
97
|
+
if (!deployConfig) {
|
|
98
98
|
return [];
|
|
99
99
|
}
|
|
100
100
|
if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
@@ -104,16 +104,16 @@ var createKubeValues = function (context) {
|
|
|
104
104
|
var values = deployConfig.values;
|
|
105
105
|
// we remove the application config because it can be just the value `false` which is a convenience feature, but not supported in the helm chart
|
|
106
106
|
// we only merge the rest of the values in
|
|
107
|
-
var
|
|
108
|
-
application =
|
|
109
|
-
jobs =
|
|
110
|
-
cronjobs =
|
|
111
|
-
rest = __rest(
|
|
107
|
+
var _d = values !== null && values !== void 0 ? values : {},
|
|
108
|
+
application = _d.application,
|
|
109
|
+
jobs = _d.jobs,
|
|
110
|
+
cronjobs = _d.cronjobs,
|
|
111
|
+
rest = __rest(_d, ["application", "jobs", "cronjobs"]);
|
|
112
112
|
var env = (0, kubeEnv_1.createKubeEnv)(context);
|
|
113
113
|
var defaultKubeValues = (0, lodash_1.merge)({
|
|
114
114
|
env: env,
|
|
115
115
|
application: createAppConfig(context, application)
|
|
116
|
-
}, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(context) : {}, ((
|
|
116
|
+
}, (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) : {});
|
|
117
117
|
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
118
118
|
jobs: removeFalsy(jobs),
|
|
119
119
|
cronjobs: removeFalsy(cronjobs)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const createMongodbBaseConfig: (context:
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
export declare const createMongodbBaseConfig: (context: ComponentContext) => {
|
|
3
3
|
mongodb: {
|
|
4
4
|
enabled: boolean;
|
|
5
5
|
auth: {
|
|
@@ -33,15 +33,15 @@ var getMongodbReplicasetHost = function (context, index) {
|
|
|
33
33
|
return getMongodbHost(context, "".concat(fullAppname, "-mongodb-").concat(index, ".").concat(fullAppname, "-mongodb-headless"));
|
|
34
34
|
};
|
|
35
35
|
var createMongodbUrl = function (context, dbName) {
|
|
36
|
-
var _a, _b;
|
|
37
|
-
if (!(0, types_1.isOfDeployType)(context.
|
|
36
|
+
var _a, _b, _c, _d;
|
|
37
|
+
if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
|
|
38
38
|
throw new Error("can only createMongodbUrl on supported deploys");
|
|
39
39
|
}
|
|
40
|
-
var mongodbConfig = (
|
|
40
|
+
var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
|
|
41
41
|
var queryParams = undefined;
|
|
42
42
|
var hosts = "";
|
|
43
43
|
if ((mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.architecture) === "replicaset") {
|
|
44
|
-
hosts = (0, lodash_1.range)(0, (
|
|
44
|
+
hosts = (0, lodash_1.range)(0, (_d = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.replicaCount) !== null && _d !== void 0 ? _d : 2).map(function (i) {
|
|
45
45
|
return getMongodbReplicasetHost(context, i);
|
|
46
46
|
}).join(",");
|
|
47
47
|
queryParams = "replicaSet=rs0&authSource=admin";
|
|
@@ -52,11 +52,11 @@ var createMongodbUrl = function (context, dbName) {
|
|
|
52
52
|
return "mongodb://".concat(getCredentialString(context)).concat(hosts, "/").concat(dbName).concat(queryParams ? "?".concat(queryParams) : "");
|
|
53
53
|
};
|
|
54
54
|
var createMongoBackupDefaultConfig = function (context) {
|
|
55
|
-
var _a;
|
|
56
|
-
if (!(0, types_1.isOfDeployType)(context.
|
|
55
|
+
var _a, _b, _c;
|
|
56
|
+
if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
|
|
57
57
|
throw new Error("can only create mongodb base config on supported deploys");
|
|
58
58
|
}
|
|
59
|
-
var mongodbConfig = (
|
|
59
|
+
var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
|
|
60
60
|
var fullAppName = context.environment.envVars.KUBE_APP_NAME;
|
|
61
61
|
var backupEnabled = ["prod", "stage"].includes(context.environment.envType);
|
|
62
62
|
var hostToBackup;
|
|
@@ -81,11 +81,11 @@ var createMongoBackupDefaultConfig = function (context) {
|
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
var createMongodbBaseConfig = function (context) {
|
|
84
|
-
var _a, _b;
|
|
85
|
-
if (!(0, types_1.isOfDeployType)(context.
|
|
84
|
+
var _a, _b, _c, _d;
|
|
85
|
+
if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
|
|
86
86
|
throw new Error("can only create mongodb base config on supported deploys");
|
|
87
87
|
}
|
|
88
|
-
var mongodbConfig = (
|
|
88
|
+
var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
|
|
89
89
|
return {
|
|
90
90
|
mongodb: {
|
|
91
91
|
enabled: true,
|
|
@@ -101,7 +101,7 @@ var createMongodbBaseConfig = function (context) {
|
|
|
101
101
|
},
|
|
102
102
|
env: {
|
|
103
103
|
secret: __assign({
|
|
104
|
-
MONGO_URL: createMongodbUrl(context, (
|
|
104
|
+
MONGO_URL: createMongodbUrl(context, (_d = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.dbName) !== null && _d !== void 0 ? _d : "app")
|
|
105
105
|
}, (mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.architecture) === "replicaset" ? {
|
|
106
106
|
MONGO_OPLOG_URL: createMongodbUrl(context, "local")
|
|
107
107
|
} // oplog only works with replicasets
|
package/dist/deploy/sbom.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const sbomDeactivated: (context:
|
|
3
|
-
export declare const getDependencyTrackUploadScript: (context:
|
|
4
|
-
export declare const getDependencyTrackDeleteScript: (context:
|
|
1
|
+
import type { ComponentContext } from "../types/context";
|
|
2
|
+
export declare const sbomDeactivated: (context: ComponentContext) => boolean;
|
|
3
|
+
export declare const getDependencyTrackUploadScript: (context: ComponentContext) => string[];
|
|
4
|
+
export declare const getDependencyTrackDeleteScript: (context: ComponentContext) => string[];
|
package/dist/deploy/sbom.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getDependencyTrackDeleteScript = exports.getDependencyTrackUploadScript = exports.sbomDeactivated = void 0;
|
|
7
7
|
var sbom_1 = require("../build/sbom");
|
|
8
8
|
var sbomDeactivated = function (context) {
|
|
9
|
-
return context.
|
|
9
|
+
return context.build.config.type === "custom" && context.build.config.sbom === false;
|
|
10
10
|
};
|
|
11
11
|
exports.sbomDeactivated = sbomDeactivated;
|
|
12
12
|
var getDependencyTrackUploadScript = function (context) {
|
|
@@ -11,7 +11,7 @@ export type DeployConfigType = DeployConfig["type"];
|
|
|
11
11
|
export type DeployConfigGeneric<T extends DeployConfigType> = Extract<DeployConfig, {
|
|
12
12
|
type: T;
|
|
13
13
|
}>;
|
|
14
|
-
export declare const isOfDeployType: <T extends ("kubernetes" | "custom" | "google-cloudrun" | "dockerTag")[]>(t: DeployConfig | false, ...types: T) => t is Extract<DeployConfigKubernetes, {
|
|
14
|
+
export declare const isOfDeployType: <T extends ("kubernetes" | "custom" | "google-cloudrun" | "dockerTag")[]>(t: DeployConfig | false | null | undefined, ...types: T) => t is Extract<DeployConfigKubernetes, {
|
|
15
15
|
type: T[number];
|
|
16
16
|
}> | Extract<DeployConfigCustom, {
|
|
17
17
|
type: T[number];
|
|
@@ -32,6 +32,6 @@ var isOfDeployType = function (t) {
|
|
|
32
32
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
33
33
|
types[_i - 1] = arguments[_i];
|
|
34
34
|
}
|
|
35
|
-
return t && types.includes(t.type);
|
|
35
|
+
return t && types.includes(t.type) ? true : false;
|
|
36
36
|
};
|
|
37
37
|
exports.isOfDeployType = isOfDeployType;
|
package/dist/deploy/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Config,
|
|
1
|
+
import type { Config, ComponentContext } from "../types";
|
|
2
2
|
import type { DeployConfigKubernetesCluster } from "./types";
|
|
3
3
|
export declare const getFullKubernetesClusterName: (cluster: DeployConfigKubernetesCluster) => string | undefined;
|
|
4
4
|
export declare const getKubernetesNamespace: (config: Pick<Config, "customerName" | "appName">, env: string) => string;
|
|
5
|
-
export declare const contextIsStoppable: (context:
|
|
5
|
+
export declare const contextIsStoppable: (context: ComponentContext) => boolean;
|
package/dist/deploy/utils.js
CHANGED
|
@@ -16,7 +16,8 @@ var getKubernetesNamespace = function (config, env) {
|
|
|
16
16
|
};
|
|
17
17
|
exports.getKubernetesNamespace = getKubernetesNamespace;
|
|
18
18
|
var contextIsStoppable = function (context) {
|
|
19
|
-
var
|
|
19
|
+
var _a;
|
|
20
|
+
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
20
21
|
if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
21
22
|
return true;
|
|
22
23
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CreateComponentContextContext } from "../context";
|
|
2
2
|
import type { CatladderJobWithContext } from "../types/context";
|
|
3
|
-
export declare const createJobsForComponent: (contextContext: Omit<
|
|
3
|
+
export declare const createJobsForComponent: (contextContext: Omit<CreateComponentContextContext, "packageManagerInfo">) => Promise<Array<CatladderJobWithContext>>;
|
|
@@ -168,7 +168,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
168
168
|
value: true
|
|
169
169
|
});
|
|
170
170
|
exports.createJobsForComponent = void 0;
|
|
171
|
-
var lodash_1 = require("lodash");
|
|
172
171
|
var build_1 = require("../build");
|
|
173
172
|
var context_1 = require("../context");
|
|
174
173
|
var deploy_1 = require("../deploy");
|
|
@@ -184,15 +183,16 @@ var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
|
184
183
|
});
|
|
185
184
|
};
|
|
186
185
|
var getCustomJobs = function (context) {
|
|
187
|
-
if (!context.
|
|
186
|
+
if (!context.customJobs) {
|
|
188
187
|
return [];
|
|
189
188
|
}
|
|
190
|
-
var rawJobs =
|
|
189
|
+
var rawJobs = context.customJobs;
|
|
191
190
|
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
192
191
|
};
|
|
193
192
|
var createRawJobs = function (context) {
|
|
194
|
-
var
|
|
195
|
-
var
|
|
193
|
+
var _a, _b;
|
|
194
|
+
var buildJobs = build_1.BUILD_TYPES[context.build.config.type].jobs(context);
|
|
195
|
+
var deployJobs = ((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config) ? deploy_1.DEPLOY_TYPES[(_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.type].jobs(context) : [];
|
|
196
196
|
var customJobs = getCustomJobs(context);
|
|
197
197
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
198
198
|
};
|
|
@@ -205,7 +205,7 @@ var createJobsForComponent = function (contextContext) {
|
|
|
205
205
|
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(contextContext.config, contextContext.componentName)];
|
|
206
206
|
case 1:
|
|
207
207
|
packageManagerInfo = _a.sent();
|
|
208
|
-
return [4 /*yield*/, (0, context_1.
|
|
208
|
+
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), {
|
|
209
209
|
packageManagerInfo: packageManagerInfo
|
|
210
210
|
}))];
|
|
211
211
|
case 2:
|