@catladder/pipeline 0.0.0-vars-07a720d0 → 0.0.0-waitfor-deploy-e64a33ba
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/createBuildJob.js +3 -1
- package/dist/build/docker.d.ts +1 -0
- package/dist/build/docker.js +19 -1
- package/dist/build/index.js +1 -1
- package/dist/build/node/buildJob.js +2 -2
- package/dist/build/node/yarn.d.ts +1 -0
- package/dist/build/node/yarn.js +43 -2
- package/dist/catladder-gitlab.js +8 -6
- package/dist/config/readConfig.d.ts +5 -1
- package/dist/config/readConfig.js +20 -5
- package/dist/constants.js +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +14 -8
- package/dist/context/resolveReferences.d.ts +1 -1
- package/dist/context/resolveReferences.js +9 -4
- package/dist/deploy/base.js +29 -10
- package/dist/deploy/custom/deployJob.d.ts +3 -0
- package/dist/deploy/custom/deployJob.js +65 -0
- package/dist/deploy/custom/index.d.ts +1 -0
- package/dist/deploy/custom/index.js +22 -0
- package/dist/deploy/index.js +8 -0
- package/dist/deploy/kubernetes/deployJob.js +3 -1
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +87 -0
- package/dist/deploy/kubernetes/processSecretsAsFiles.js +39 -0
- package/dist/deploy/types.d.ts +58 -21
- package/dist/deploy/utils.d.ts +4 -3
- package/dist/deploy/utils.js +20 -2
- package/dist/pipeline/createJobs.js +59 -15
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +12 -0
- package/dist/types/context.d.ts +1 -1
- package/dist/types/jobs.d.ts +6 -1
- package/package.json +1 -1
- package/src/build/base/createBuildJob.ts +2 -0
- package/src/build/docker.ts +14 -0
- package/src/build/index.ts +1 -1
- package/src/build/node/buildJob.ts +29 -24
- package/src/build/node/yarn.ts +5 -1
- package/src/catladder-gitlab.ts +1 -1
- package/src/config/readConfig.ts +18 -6
- package/src/context/index.ts +14 -8
- package/src/context/resolveReferences.ts +16 -12
- package/src/deploy/base.ts +36 -11
- package/src/deploy/custom/deployJob.ts +23 -0
- package/src/deploy/custom/index.ts +1 -0
- package/src/deploy/index.ts +5 -0
- package/src/deploy/kubernetes/deployJob.ts +4 -3
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +34 -0
- package/src/deploy/types.ts +53 -4
- package/src/deploy/utils.ts +15 -2
- package/src/pipeline/createJobs.ts +50 -16
- package/src/types/config.ts +12 -0
- package/src/types/context.ts +1 -1
- package/src/types/jobs.ts +7 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const processSecretsAsFiles: <T extends {
|
|
2
|
+
env: {
|
|
3
|
+
secret: Record<string, string>;
|
|
4
|
+
};
|
|
5
|
+
} & {
|
|
6
|
+
cloudsql?: {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
instanceId?: string | undefined;
|
|
9
|
+
projectId?: string | undefined;
|
|
10
|
+
region?: string | undefined;
|
|
11
|
+
} | undefined;
|
|
12
|
+
mongodb?: ({
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
} & Record<string, unknown>) | undefined;
|
|
15
|
+
mailhog?: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
} | undefined;
|
|
18
|
+
jobs?: Record<string, {
|
|
19
|
+
command: string;
|
|
20
|
+
} & Record<string, unknown>> | undefined;
|
|
21
|
+
cronjobs?: Record<string, {
|
|
22
|
+
schedule: string;
|
|
23
|
+
command: string;
|
|
24
|
+
concurrencyPolicy?: "Forbid" | "Allow" | "Replace" | undefined;
|
|
25
|
+
} & Record<string, unknown>> | undefined;
|
|
26
|
+
application?: ({
|
|
27
|
+
redirects?: ({
|
|
28
|
+
host: string;
|
|
29
|
+
} & Record<string, unknown>)[] | undefined;
|
|
30
|
+
replicas?: number | undefined;
|
|
31
|
+
autoscale?: import("../types").KubernetesAutoscale | undefined;
|
|
32
|
+
resources?: {
|
|
33
|
+
limits?: {
|
|
34
|
+
cpu?: string | undefined;
|
|
35
|
+
memory?: string | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
requests?: {
|
|
38
|
+
cpu?: string | undefined;
|
|
39
|
+
memory?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
healthRoute?: string | undefined;
|
|
43
|
+
startupProbe?: {
|
|
44
|
+
httpGet?: {
|
|
45
|
+
path?: string | undefined;
|
|
46
|
+
port?: number | undefined;
|
|
47
|
+
httpHeaders?: {
|
|
48
|
+
name: string;
|
|
49
|
+
value: string;
|
|
50
|
+
}[] | undefined;
|
|
51
|
+
failureThreshold?: number | undefined;
|
|
52
|
+
timeoutSeconds?: number | undefined;
|
|
53
|
+
periodSeconds?: number | undefined;
|
|
54
|
+
successThreshold?: number | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
} | undefined;
|
|
57
|
+
readinessProbe?: {
|
|
58
|
+
httpGet?: {
|
|
59
|
+
path?: string | undefined;
|
|
60
|
+
port?: number | undefined;
|
|
61
|
+
httpHeaders?: {
|
|
62
|
+
name: string;
|
|
63
|
+
value: string;
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
failureThreshold?: number | undefined;
|
|
66
|
+
timeoutSeconds?: number | undefined;
|
|
67
|
+
periodSeconds?: number | undefined;
|
|
68
|
+
successThreshold?: number | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
livenessProbe?: {
|
|
72
|
+
httpGet?: {
|
|
73
|
+
path?: string | undefined;
|
|
74
|
+
port?: number | undefined;
|
|
75
|
+
httpHeaders?: {
|
|
76
|
+
name: string;
|
|
77
|
+
value: string;
|
|
78
|
+
}[] | undefined;
|
|
79
|
+
failureThreshold?: number | undefined;
|
|
80
|
+
timeoutSeconds?: number | undefined;
|
|
81
|
+
periodSeconds?: number | undefined;
|
|
82
|
+
successThreshold?: number | undefined;
|
|
83
|
+
} | undefined;
|
|
84
|
+
} | undefined;
|
|
85
|
+
} & Record<string, unknown>) | undefined;
|
|
86
|
+
secretsAsFile?: string[] | undefined;
|
|
87
|
+
} & Record<string, unknown>>(values: T) => T;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __assign = this && this.__assign || function () {
|
|
4
|
+
__assign = Object.assign || function (t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
|
|
8
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.__esModule = true;
|
|
18
|
+
exports.processSecretsAsFiles = void 0;
|
|
19
|
+
|
|
20
|
+
var lodash_1 = require("lodash");
|
|
21
|
+
|
|
22
|
+
var processSecretsAsFiles = function (values) {
|
|
23
|
+
if (!values.secretsAsFile || values.secretsAsFile.length === 0) {
|
|
24
|
+
return values;
|
|
25
|
+
} // the initial idea was that we "shadow" secrets that we mount as files,
|
|
26
|
+
// but there is a weird kubernetes issue with that (https://github.com/kubernetes/kubernetes/issues/46861),
|
|
27
|
+
// 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
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
return __assign(__assign({}, values), {
|
|
31
|
+
env: __assign(__assign({}, values.env), {
|
|
32
|
+
secret: __assign(__assign({}, (0, lodash_1.omit)(values.env.secret, values.secretsAsFile)), Object.fromEntries(values.secretsAsFile.map(function (key) {
|
|
33
|
+
return [key + "_content", values.env.secret[key]];
|
|
34
|
+
})))
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.processSecretsAsFiles = processSecretsAsFiles;
|
package/dist/deploy/types.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
export declare type DeployConfigBase = {
|
|
1
|
+
export declare type DeployConfigBase = {
|
|
2
|
+
/**
|
|
3
|
+
* whether to deploy automatically or manual. If not defined, these rules apply:
|
|
4
|
+
* - prod: manual
|
|
5
|
+
* - all other envs: auto
|
|
6
|
+
*/
|
|
7
|
+
when?: "manual" | "auto";
|
|
8
|
+
/**
|
|
9
|
+
* EXPERIMENTAL
|
|
10
|
+
* wait for other components to deploy first, before doing this deployment
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
waitFor?: string[];
|
|
14
|
+
};
|
|
2
15
|
declare type AllowUnknownProps<T extends Record<string, unknown>> = T & Record<string, unknown>;
|
|
3
16
|
export declare type DeployConfigKubernetesClusterGCloud = {
|
|
4
17
|
type: "gcloud";
|
|
@@ -24,6 +37,29 @@ export declare type DeployConfigKubernetesClusterGCloud = {
|
|
|
24
37
|
domainCanonical?: string;
|
|
25
38
|
};
|
|
26
39
|
export declare type DeployConfigKubernetesCluster = DeployConfigKubernetesClusterGCloud;
|
|
40
|
+
export declare type KubernetesAutoscaleMetricResourceTarget = {
|
|
41
|
+
type: "Utilization";
|
|
42
|
+
averageUtilization: number;
|
|
43
|
+
} | {
|
|
44
|
+
type: "AverageValue";
|
|
45
|
+
averageValue: number | string;
|
|
46
|
+
};
|
|
47
|
+
export declare type KubernetesAutoscaleMetric = {
|
|
48
|
+
type: "Resource";
|
|
49
|
+
resource: {
|
|
50
|
+
name: "cpu" | "memory";
|
|
51
|
+
target: KubernetesAutoscaleMetricResourceTarget;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare type KubernetesAutoscale = {
|
|
55
|
+
minReplicas: number;
|
|
56
|
+
maxReplicas: number;
|
|
57
|
+
/**
|
|
58
|
+
* declare a number of metrics (at least one). Usually you would use cpu as a metric
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
metrics: KubernetesAutoscaleMetric[];
|
|
62
|
+
};
|
|
27
63
|
declare type KubernetesHealthDef = {
|
|
28
64
|
httpGet?: {
|
|
29
65
|
path?: string;
|
|
@@ -101,6 +137,11 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
101
137
|
*/
|
|
102
138
|
|
|
103
139
|
replicas?: number;
|
|
140
|
+
/**
|
|
141
|
+
* autoscale the pods horizontally
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
autoscale?: KubernetesAutoscale;
|
|
104
145
|
/**
|
|
105
146
|
* kubernetes resources
|
|
106
147
|
*/
|
|
@@ -120,6 +161,12 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
120
161
|
readinessProbe?: KubernetesHealthDef;
|
|
121
162
|
livenessProbe?: KubernetesHealthDef;
|
|
122
163
|
}>;
|
|
164
|
+
/**
|
|
165
|
+
* Mount secrets as files in the filesystem.
|
|
166
|
+
* These secrets are still available as env vars, but will contain the path of the file instead
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
secretsAsFile?: string[];
|
|
123
170
|
}>;
|
|
124
171
|
export declare type DeployConfigKubernetes = {
|
|
125
172
|
type: "kubernetes";
|
|
@@ -140,26 +187,16 @@ export declare type DeployConfigKubernetes = {
|
|
|
140
187
|
|
|
141
188
|
values?: DeployConfigKubernetesValues;
|
|
142
189
|
} & DeployConfigBase;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
debug?: boolean | undefined;
|
|
156
|
-
additionalHelmArgs?: string[] | undefined;
|
|
157
|
-
/**
|
|
158
|
-
* values to configure the app
|
|
159
|
-
*/
|
|
160
|
-
|
|
161
|
-
values?: DeployConfigKubernetesValues | undefined;
|
|
162
|
-
}, {
|
|
190
|
+
declare type DeployConfigCustom = {
|
|
191
|
+
type: "custom";
|
|
192
|
+
requiresDocker: boolean;
|
|
193
|
+
script: string[];
|
|
194
|
+
stopScript?: string[];
|
|
195
|
+
} & DeployConfigBase;
|
|
196
|
+
export declare type DeployConfig = DeployConfigKubernetes | DeployConfigCustom;
|
|
197
|
+
export declare const isOfDeployType: <T extends ("kubernetes" | "custom")[]>(t: DeployConfig | false, ...types: T) => t is Extract<DeployConfigKubernetes, {
|
|
198
|
+
type: T[number];
|
|
199
|
+
}> | Extract<DeployConfigCustom, {
|
|
163
200
|
type: T[number];
|
|
164
201
|
}>;
|
|
165
202
|
export {};
|
package/dist/deploy/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Config } from "../types";
|
|
2
|
-
import
|
|
1
|
+
import { Config, Context } from "../types";
|
|
2
|
+
import { DeployConfigKubernetesCluster } from "./types";
|
|
3
3
|
export declare const getFullKubernetesClusterName: (cluster: DeployConfigKubernetesCluster) => string | undefined;
|
|
4
|
-
export declare const getKubernetesNamespace: (config: Pick<Config, "customerName" | "appName">, env: string) => string;
|
|
4
|
+
export declare const getKubernetesNamespace: (config: Pick<Config, "customerName" | "appName">, env: string) => string;
|
|
5
|
+
export declare const contextIsStoppable: (context: Context) => boolean;
|
package/dist/deploy/utils.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.getKubernetesNamespace = exports.getFullKubernetesClusterName = void 0;
|
|
4
|
+
exports.contextIsStoppable = exports.getKubernetesNamespace = exports.getFullKubernetesClusterName = void 0;
|
|
5
|
+
|
|
6
|
+
var types_1 = require("./types");
|
|
5
7
|
|
|
6
8
|
var getFullKubernetesClusterName = function (cluster) {
|
|
7
9
|
if (cluster.type === "gcloud") {
|
|
@@ -15,4 +17,20 @@ var getKubernetesNamespace = function (config, env) {
|
|
|
15
17
|
return "".concat(config.customerName, "-").concat(config.appName, "-").concat(env);
|
|
16
18
|
};
|
|
17
19
|
|
|
18
|
-
exports.getKubernetesNamespace = getKubernetesNamespace;
|
|
20
|
+
exports.getKubernetesNamespace = getKubernetesNamespace;
|
|
21
|
+
|
|
22
|
+
var contextIsStoppable = function (context) {
|
|
23
|
+
var deployConfig = context.componentConfig.deploy;
|
|
24
|
+
|
|
25
|
+
if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if ((0, types_1.isOfDeployType)(deployConfig, "custom") && deployConfig.stopScript) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return false;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.contextIsStoppable = contextIsStoppable;
|
|
@@ -155,6 +155,17 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
159
|
+
var t = {};
|
|
160
|
+
|
|
161
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
162
|
+
|
|
163
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
164
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
165
|
+
}
|
|
166
|
+
return t;
|
|
167
|
+
};
|
|
168
|
+
|
|
158
169
|
var __read = this && this.__read || function (o, n) {
|
|
159
170
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
160
171
|
if (!m) return o;
|
|
@@ -209,6 +220,28 @@ var makeGitlabJob_1 = require("./gitlab/makeGitlabJob");
|
|
|
209
220
|
|
|
210
221
|
var packageManager_1 = require("./packageManager");
|
|
211
222
|
|
|
223
|
+
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
224
|
+
return jobs.map(function (_a) {
|
|
225
|
+
var _b;
|
|
226
|
+
|
|
227
|
+
var variables = _a.variables,
|
|
228
|
+
job = __rest(_a, ["variables"]);
|
|
229
|
+
|
|
230
|
+
return __assign({
|
|
231
|
+
variables: __assign(__assign({}, (_b = context.environment.envVars) !== null && _b !== void 0 ? _b : {}), variables !== null && variables !== void 0 ? variables : {})
|
|
232
|
+
}, job);
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
var getCustomJobs = function (context) {
|
|
237
|
+
if (!context.componentConfig.customJobs) {
|
|
238
|
+
return [];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var rawJobs = (0, lodash_1.isFunction)(context.componentConfig.customJobs) ? context.componentConfig.customJobs(context) : context.componentConfig.customJobs;
|
|
242
|
+
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
243
|
+
};
|
|
244
|
+
|
|
212
245
|
var createRawJobs = function (context) {
|
|
213
246
|
if (context.componentConfig.deploy === false) {
|
|
214
247
|
return [];
|
|
@@ -216,7 +249,8 @@ var createRawJobs = function (context) {
|
|
|
216
249
|
|
|
217
250
|
var buildJobs = build_1.BUILD_TYPES[context.componentConfig.build.type].jobs(context);
|
|
218
251
|
var deployJobs = deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context);
|
|
219
|
-
|
|
252
|
+
var customJobs = getCustomJobs(context);
|
|
253
|
+
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
220
254
|
};
|
|
221
255
|
|
|
222
256
|
var getFullJobName = function (name, componentName, env) {
|
|
@@ -243,18 +277,28 @@ var getFullReferencedJobName = function (referencedJobName, componentName, env,
|
|
|
243
277
|
|
|
244
278
|
|
|
245
279
|
var replaceReferences = function (job, componentName, env, allRawJobs) {
|
|
246
|
-
var _a, _b;
|
|
280
|
+
var _a, _b, _c;
|
|
247
281
|
|
|
248
282
|
var stage = job.envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
283
|
+
var needsFromNeeds = (_a = job.needs) === null || _a === void 0 ? void 0 : _a.map(function (n) {
|
|
284
|
+
return (0, lodash_1.isObject)(n) ? {
|
|
285
|
+
job: getFullReferencedJobName(n.job, componentName, env, allRawJobs),
|
|
286
|
+
artifacts: n.artifacts
|
|
287
|
+
} : getFullReferencedJobName(n, componentName, env, allRawJobs);
|
|
288
|
+
});
|
|
289
|
+
var needsFromOtherComponents = (_b = job.needsOtherComponent) === null || _b === void 0 ? void 0 : _b.map(function (other) {
|
|
290
|
+
return {
|
|
291
|
+
artifacts: other.artifacts,
|
|
292
|
+
job: getFullReferencedJobName(other.job, other.componentName, env, allRawJobs)
|
|
293
|
+
};
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
var needs = __spreadArray(__spreadArray([], __read(needsFromNeeds !== null && needsFromNeeds !== void 0 ? needsFromNeeds : []), false), __read(needsFromOtherComponents !== null && needsFromOtherComponents !== void 0 ? needsFromOtherComponents : []), false);
|
|
297
|
+
|
|
249
298
|
return __assign(__assign({}, job), {
|
|
250
299
|
stage: stage,
|
|
251
|
-
needs:
|
|
252
|
-
|
|
253
|
-
job: getFullReferencedJobName(n.job, componentName, env, allRawJobs),
|
|
254
|
-
artifacts: n.artifacts
|
|
255
|
-
} : getFullReferencedJobName(n, componentName, env, allRawJobs);
|
|
256
|
-
}),
|
|
257
|
-
environment: ((_b = job.environment) === null || _b === void 0 ? void 0 : _b.on_stop) ? __assign(__assign({}, job.environment), {
|
|
300
|
+
needs: needs,
|
|
301
|
+
environment: ((_c = job.environment) === null || _c === void 0 ? void 0 : _c.on_stop) ? __assign(__assign({}, job.environment), {
|
|
258
302
|
on_stop: getFullReferencedJobName(job.environment.on_stop, componentName, env, allRawJobs)
|
|
259
303
|
}) : job.environment
|
|
260
304
|
});
|
|
@@ -296,14 +340,14 @@ var createJobs = function (type, envs, config, componentName, trigger) {
|
|
|
296
340
|
|
|
297
341
|
var _a;
|
|
298
342
|
|
|
299
|
-
var _b
|
|
343
|
+
var _b;
|
|
300
344
|
|
|
301
|
-
return __generator(this, function (
|
|
302
|
-
switch (
|
|
345
|
+
return __generator(this, function (_c) {
|
|
346
|
+
switch (_c.label) {
|
|
303
347
|
case 0:
|
|
304
348
|
_a = {
|
|
305
349
|
refName: (_b = process.env.CI_COMMIT_REF_NAME) !== null && _b !== void 0 ? _b : "unknown",
|
|
306
|
-
|
|
350
|
+
reviewSlug: process.env.CI_MERGE_REQUEST_IID ? "mr".concat(process.env.CI_MERGE_REQUEST_IID) : "unknown",
|
|
307
351
|
buildTime: new Date().toISOString()
|
|
308
352
|
};
|
|
309
353
|
return [4
|
|
@@ -313,13 +357,13 @@ var createJobs = function (type, envs, config, componentName, trigger) {
|
|
|
313
357
|
})];
|
|
314
358
|
|
|
315
359
|
case 1:
|
|
316
|
-
commitInfo = (_a.buildId =
|
|
360
|
+
commitInfo = (_a.buildId = _c.sent(), _a.trigger = trigger, _a);
|
|
317
361
|
return [4
|
|
318
362
|
/*yield*/
|
|
319
363
|
, (0, packageManager_1.getPackageManagerInfo)(config, componentName)];
|
|
320
364
|
|
|
321
365
|
case 2:
|
|
322
|
-
packageManagerInfo =
|
|
366
|
+
packageManagerInfo = _c.sent();
|
|
323
367
|
return [2
|
|
324
368
|
/*return*/
|
|
325
369
|
, envs.reduce(function (acc, env) {
|