@catladder/pipeline 1.75.4 → 1.76.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/createBuildJob.js +5 -27
- package/dist/build/base/writeBuildInfo.js +0 -3
- package/dist/build/custom/buildJob.js +3 -23
- package/dist/build/custom/index.js +3 -10
- package/dist/build/docker.js +5 -40
- package/dist/build/index.js +0 -8
- package/dist/build/node/buildJob.js +3 -25
- package/dist/build/node/cache.js +3 -21
- package/dist/build/node/index.js +3 -16
- package/dist/build/node/meteor.js +3 -20
- package/dist/build/node/testJob.js +5 -22
- package/dist/build/node/yarn.js +5 -18
- package/dist/build/rails/build.js +2 -8
- package/dist/build/rails/index.js +3 -11
- package/dist/build/rails/test.js +5 -18
- package/dist/build/types.d.ts +0 -9
- package/dist/build/types.js +0 -4
- package/dist/bundles/catladder-gitlab/index.js +1 -1
- package/dist/catladder-gitlab.js +6 -24
- package/dist/config/{configruedEnvs.test.d.ts → __tests__/configruedEnvs.test.d.ts} +0 -0
- package/dist/config/{configruedEnvs.test.js → __tests__/configruedEnvs.test.js} +10 -12
- package/dist/config/configruedEnvs.js +7 -22
- package/dist/config/index.js +0 -4
- package/dist/config/readConfig.js +2 -13
- package/dist/constants.js +1 -1
- package/dist/context/{resolveReferences.test.d.ts → __tests__/resolveReferences.test.d.ts} +0 -0
- package/dist/context/{resolveReferences.test.js → __tests__/resolveReferences.test.js} +52 -103
- package/dist/context/getEnvConfig.js +0 -8
- package/dist/context/getEnvType.js +0 -5
- package/dist/context/getEnvironment.js +13 -49
- package/dist/context/getEnvironmentContext.js +0 -5
- package/dist/context/getEnvironmentVariables.js +20 -83
- package/dist/context/getLabels.js +2 -13
- package/dist/context/index.js +13 -58
- package/dist/context/resolveReferences.js +36 -126
- package/dist/deploy/base.js +4 -19
- package/dist/deploy/cloudRun/deployJob.js +19 -61
- package/dist/deploy/cloudRun/index.js +17 -39
- package/dist/deploy/cloudRun/utils/database.js +11 -29
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +0 -4
- package/dist/deploy/cloudRun/utils/jobName.js +0 -2
- package/dist/deploy/custom/deployJob.js +3 -18
- package/dist/deploy/custom/index.js +0 -2
- package/dist/deploy/dockerTag/deployJob.js +0 -9
- package/dist/deploy/dockerTag/index.js +0 -2
- package/dist/deploy/index.js +0 -11
- package/dist/deploy/kubernetes/additionalSecretKeys.js +0 -9
- package/dist/deploy/kubernetes/cloudSql/index.js +0 -12
- package/dist/deploy/kubernetes/deployJob.js +3 -24
- package/dist/deploy/kubernetes/index.js +7 -17
- package/dist/deploy/kubernetes/kubeEnv.d.ts +0 -1
- package/dist/deploy/kubernetes/kubeEnv.js +5 -23
- package/dist/deploy/kubernetes/kubeValues.js +6 -24
- package/dist/deploy/kubernetes/mongodb.js +0 -24
- package/dist/deploy/kubernetes/processSecretsAsFiles.js +2 -10
- package/dist/deploy/types/base.d.ts +0 -1
- package/dist/deploy/types/custom.d.ts +0 -6
- package/dist/deploy/types/googleCloudRun.d.ts +4 -12
- package/dist/deploy/types/index.js +0 -10
- package/dist/deploy/types/kubernetes.d.ts +0 -28
- package/dist/deploy/utils.js +0 -11
- package/dist/index.js +0 -10
- package/dist/pipeline/commitInfo/getBuildId.d.ts +1 -0
- package/dist/pipeline/{createChildPipeline.test.js → commitInfo/getBuildId.js} +25 -84
- package/dist/pipeline/commitInfo/getCommitInfo.d.ts +2 -0
- package/dist/{build/tests/storybook.test.js → pipeline/commitInfo/getCommitInfo.js} +30 -104
- package/dist/pipeline/createChildPipeline.js +19 -76
- package/dist/pipeline/createJobs.js +35 -135
- package/dist/pipeline/gitlab/makeGitlabJob.d.ts +1 -0
- package/dist/pipeline/gitlab/makeGitlabJob.js +13 -15
- package/dist/pipeline/index.js +0 -4
- package/dist/pipeline/packageManager.js +20 -173
- package/dist/pipeline/yarn/yarnUtils.d.ts +4 -0
- package/dist/pipeline/yarn/yarnUtils.js +193 -0
- package/dist/runner/index.js +0 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +0 -13
- package/dist/types/config.js +5 -15
- package/dist/types/context.d.ts +0 -2
- package/dist/types/environmentContext.d.ts +0 -1
- package/dist/types/gitlab-types.d.ts +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/jobs.d.ts +5 -15
- package/dist/utils/gitlab.js +3 -13
- package/dist/utils/index.js +5 -15
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +1765 -0
- package/examples/__snapshots__/custom-build-job.ts.snap +1174 -0
- package/examples/__snapshots__/custom-envs.ts.snap +261 -0
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +1626 -0
- package/examples/__utils__/helpers.ts +14 -0
- package/examples/{cloud-sql.ts → cloud-run-with-sql.ts} +12 -15
- package/examples/custom-build-job.ts +4 -1
- package/examples/custom-envs.ts +31 -0
- package/examples/wait-for-other-deploy.ts +36 -0
- package/package.json +2 -2
- package/src/config/{configruedEnvs.test.ts → __tests__/configruedEnvs.test.ts} +3 -3
- package/src/context/{resolveReferences.test.ts → __tests__/resolveReferences.test.ts} +3 -3
- package/src/deploy/cloudRun/index.ts +2 -1
- package/src/deploy/types/googleCloudRun.ts +5 -0
- package/src/pipeline/commitInfo/getBuildId.ts +6 -0
- package/src/pipeline/commitInfo/getCommitInfo.ts +12 -0
- package/src/pipeline/createChildPipeline.ts +6 -1
- package/src/pipeline/createJobs.ts +3 -10
- package/src/pipeline/gitlab/makeGitlabJob.ts +7 -1
- package/src/pipeline/packageManager.ts +4 -38
- package/src/pipeline/yarn/yarnUtils.ts +37 -0
- package/src/types/jobs.ts +2 -1
- package/tsconfig.json +1 -1
- package/dist/build/tests/storybook.test.d.ts +0 -1
- package/dist/pipeline/createChildPipeline.test.d.ts +0 -1
- package/src/build/tests/storybook.test.ts +0 -54
- package/src/pipeline/createChildPipeline.test.ts +0 -49
|
@@ -6,7 +6,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
6
6
|
resolve(value);
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
10
|
function fulfilled(value) {
|
|
12
11
|
try {
|
|
@@ -15,7 +14,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
15
14
|
reject(e);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
function rejected(value) {
|
|
20
18
|
try {
|
|
21
19
|
step(generator["throw"](value));
|
|
@@ -23,29 +21,26 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
23
21
|
reject(e);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
|
-
|
|
27
24
|
function step(result) {
|
|
28
25
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29
26
|
}
|
|
30
|
-
|
|
31
27
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
28
|
});
|
|
33
29
|
};
|
|
34
|
-
|
|
35
30
|
var __generator = this && this.__generator || function (thisArg, body) {
|
|
36
31
|
var _ = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function () {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
38
|
+
ops: []
|
|
41
39
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
y,
|
|
47
|
-
t,
|
|
48
|
-
g;
|
|
40
|
+
f,
|
|
41
|
+
y,
|
|
42
|
+
t,
|
|
43
|
+
g;
|
|
49
44
|
return g = {
|
|
50
45
|
next: verb(0),
|
|
51
46
|
"throw": verb(1),
|
|
@@ -53,78 +48,59 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
53
48
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
54
49
|
return this;
|
|
55
50
|
}), g;
|
|
56
|
-
|
|
57
51
|
function verb(n) {
|
|
58
52
|
return function (v) {
|
|
59
53
|
return step([n, v]);
|
|
60
54
|
};
|
|
61
55
|
}
|
|
62
|
-
|
|
63
56
|
function step(op) {
|
|
64
57
|
if (f) throw new TypeError("Generator is already executing.");
|
|
65
|
-
|
|
66
58
|
while (_) try {
|
|
67
59
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
68
60
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
69
|
-
|
|
70
61
|
switch (op[0]) {
|
|
71
62
|
case 0:
|
|
72
63
|
case 1:
|
|
73
64
|
t = op;
|
|
74
65
|
break;
|
|
75
|
-
|
|
76
66
|
case 4:
|
|
77
67
|
_.label++;
|
|
78
68
|
return {
|
|
79
69
|
value: op[1],
|
|
80
70
|
done: false
|
|
81
71
|
};
|
|
82
|
-
|
|
83
72
|
case 5:
|
|
84
73
|
_.label++;
|
|
85
74
|
y = op[1];
|
|
86
75
|
op = [0];
|
|
87
76
|
continue;
|
|
88
|
-
|
|
89
77
|
case 7:
|
|
90
78
|
op = _.ops.pop();
|
|
91
|
-
|
|
92
79
|
_.trys.pop();
|
|
93
|
-
|
|
94
80
|
continue;
|
|
95
|
-
|
|
96
81
|
default:
|
|
97
82
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
98
83
|
_ = 0;
|
|
99
84
|
continue;
|
|
100
85
|
}
|
|
101
|
-
|
|
102
86
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
103
87
|
_.label = op[1];
|
|
104
88
|
break;
|
|
105
89
|
}
|
|
106
|
-
|
|
107
90
|
if (op[0] === 6 && _.label < t[1]) {
|
|
108
91
|
_.label = t[1];
|
|
109
92
|
t = op;
|
|
110
93
|
break;
|
|
111
94
|
}
|
|
112
|
-
|
|
113
95
|
if (t && _.label < t[2]) {
|
|
114
96
|
_.label = t[2];
|
|
115
|
-
|
|
116
97
|
_.ops.push(op);
|
|
117
|
-
|
|
118
98
|
break;
|
|
119
99
|
}
|
|
120
|
-
|
|
121
100
|
if (t[2]) _.ops.pop();
|
|
122
|
-
|
|
123
101
|
_.trys.pop();
|
|
124
|
-
|
|
125
102
|
continue;
|
|
126
103
|
}
|
|
127
|
-
|
|
128
104
|
op = body.call(thisArg, _);
|
|
129
105
|
} catch (e) {
|
|
130
106
|
op = [6, e];
|
|
@@ -132,7 +108,6 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
132
108
|
} finally {
|
|
133
109
|
f = t = 0;
|
|
134
110
|
}
|
|
135
|
-
|
|
136
111
|
if (op[0] & 5) throw op[1];
|
|
137
112
|
return {
|
|
138
113
|
value: op[0] ? op[1] : void 0,
|
|
@@ -140,75 +115,26 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
140
115
|
};
|
|
141
116
|
}
|
|
142
117
|
};
|
|
143
|
-
|
|
144
118
|
exports.__esModule = true;
|
|
145
|
-
|
|
146
|
-
var
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
name: "production",
|
|
163
|
-
projectId: "bla",
|
|
164
|
-
region: "europe",
|
|
165
|
-
type: "gcloud"
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
119
|
+
exports.getBaseCommitInfo = void 0;
|
|
120
|
+
var getBuildId_1 = require("./getBuildId");
|
|
121
|
+
var getBaseCommitInfo = function () {
|
|
122
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
123
|
+
var _a;
|
|
124
|
+
var _b;
|
|
125
|
+
return __generator(this, function (_c) {
|
|
126
|
+
switch (_c.label) {
|
|
127
|
+
case 0:
|
|
128
|
+
_a = {
|
|
129
|
+
refName: (_b = process.env.CI_COMMIT_REF_NAME) !== null && _b !== void 0 ? _b : "unknown",
|
|
130
|
+
reviewSlug: process.env.CI_MERGE_REQUEST_IID ? "mr".concat(process.env.CI_MERGE_REQUEST_IID) : "unknown",
|
|
131
|
+
buildTime: new Date().toISOString()
|
|
132
|
+
};
|
|
133
|
+
return [4 /*yield*/, (0, getBuildId_1.getBuildId)()];
|
|
134
|
+
case 1:
|
|
135
|
+
return [2 /*return*/, (_a.buildId = _c.sent(), _a)];
|
|
169
136
|
}
|
|
170
|
-
};
|
|
171
|
-
it("creates a pipeline for storybook that does not contain test stages", function () {
|
|
172
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
173
|
-
var jobs;
|
|
174
|
-
return __generator(this, function (_a) {
|
|
175
|
-
switch (_a.label) {
|
|
176
|
-
case 0:
|
|
177
|
-
return [4
|
|
178
|
-
/*yield*/
|
|
179
|
-
, (0, __1.createChildPipeline)("gitlab", "mainBranch", config)];
|
|
180
|
-
|
|
181
|
-
case 1:
|
|
182
|
-
jobs = _a.sent().jobs;
|
|
183
|
-
expect(Object.keys(jobs)).toEqual(["dev my-app app-build", "dev my-app docker-build", "dev my-app deploy-to-kubernetes", "dev my-app kubernetes-stop"]);
|
|
184
|
-
return [2
|
|
185
|
-
/*return*/
|
|
186
|
-
];
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
it("runs build and renames folder", function () {
|
|
192
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
193
|
-
var jobs, buildJob;
|
|
194
|
-
return __generator(this, function (_a) {
|
|
195
|
-
switch (_a.label) {
|
|
196
|
-
case 0:
|
|
197
|
-
return [4
|
|
198
|
-
/*yield*/
|
|
199
|
-
, (0, __1.createChildPipeline)("gitlab", "mainBranch", config)];
|
|
200
|
-
|
|
201
|
-
case 1:
|
|
202
|
-
jobs = _a.sent().jobs;
|
|
203
|
-
buildJob = jobs["dev my-app app-build"];
|
|
204
|
-
expect(buildJob.script).toContain("yarn storybook");
|
|
205
|
-
expect(buildJob.script).toContain("mv ./storybook-out /dist");
|
|
206
|
-
return [2
|
|
207
|
-
/*return*/
|
|
208
|
-
];
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
137
|
});
|
|
213
138
|
});
|
|
214
|
-
}
|
|
139
|
+
};
|
|
140
|
+
exports.getBaseCommitInfo = getBaseCommitInfo;
|
|
@@ -4,23 +4,18 @@ var __assign = this && this.__assign || function () {
|
|
|
4
4
|
__assign = Object.assign || function (t) {
|
|
5
5
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
6
|
s = arguments[i];
|
|
7
|
-
|
|
8
7
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return t;
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
return __assign.apply(this, arguments);
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
18
14
|
function adopt(value) {
|
|
19
15
|
return value instanceof P ? value : new P(function (resolve) {
|
|
20
16
|
resolve(value);
|
|
21
17
|
});
|
|
22
18
|
}
|
|
23
|
-
|
|
24
19
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
25
20
|
function fulfilled(value) {
|
|
26
21
|
try {
|
|
@@ -29,7 +24,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
29
24
|
reject(e);
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
|
-
|
|
33
27
|
function rejected(value) {
|
|
34
28
|
try {
|
|
35
29
|
step(generator["throw"](value));
|
|
@@ -37,29 +31,26 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
37
31
|
reject(e);
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
function step(result) {
|
|
42
35
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
43
36
|
}
|
|
44
|
-
|
|
45
37
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
38
|
});
|
|
47
39
|
};
|
|
48
|
-
|
|
49
40
|
var __generator = this && this.__generator || function (thisArg, body) {
|
|
50
41
|
var _ = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
label: 0,
|
|
43
|
+
sent: function () {
|
|
44
|
+
if (t[0] & 1) throw t[1];
|
|
45
|
+
return t[1];
|
|
46
|
+
},
|
|
47
|
+
trys: [],
|
|
48
|
+
ops: []
|
|
55
49
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
y,
|
|
61
|
-
t,
|
|
62
|
-
g;
|
|
50
|
+
f,
|
|
51
|
+
y,
|
|
52
|
+
t,
|
|
53
|
+
g;
|
|
63
54
|
return g = {
|
|
64
55
|
next: verb(0),
|
|
65
56
|
"throw": verb(1),
|
|
@@ -67,78 +58,59 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
67
58
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
68
59
|
return this;
|
|
69
60
|
}), g;
|
|
70
|
-
|
|
71
61
|
function verb(n) {
|
|
72
62
|
return function (v) {
|
|
73
63
|
return step([n, v]);
|
|
74
64
|
};
|
|
75
65
|
}
|
|
76
|
-
|
|
77
66
|
function step(op) {
|
|
78
67
|
if (f) throw new TypeError("Generator is already executing.");
|
|
79
|
-
|
|
80
68
|
while (_) try {
|
|
81
69
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
82
70
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
83
|
-
|
|
84
71
|
switch (op[0]) {
|
|
85
72
|
case 0:
|
|
86
73
|
case 1:
|
|
87
74
|
t = op;
|
|
88
75
|
break;
|
|
89
|
-
|
|
90
76
|
case 4:
|
|
91
77
|
_.label++;
|
|
92
78
|
return {
|
|
93
79
|
value: op[1],
|
|
94
80
|
done: false
|
|
95
81
|
};
|
|
96
|
-
|
|
97
82
|
case 5:
|
|
98
83
|
_.label++;
|
|
99
84
|
y = op[1];
|
|
100
85
|
op = [0];
|
|
101
86
|
continue;
|
|
102
|
-
|
|
103
87
|
case 7:
|
|
104
88
|
op = _.ops.pop();
|
|
105
|
-
|
|
106
89
|
_.trys.pop();
|
|
107
|
-
|
|
108
90
|
continue;
|
|
109
|
-
|
|
110
91
|
default:
|
|
111
92
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
112
93
|
_ = 0;
|
|
113
94
|
continue;
|
|
114
95
|
}
|
|
115
|
-
|
|
116
96
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
117
97
|
_.label = op[1];
|
|
118
98
|
break;
|
|
119
99
|
}
|
|
120
|
-
|
|
121
100
|
if (op[0] === 6 && _.label < t[1]) {
|
|
122
101
|
_.label = t[1];
|
|
123
102
|
t = op;
|
|
124
103
|
break;
|
|
125
104
|
}
|
|
126
|
-
|
|
127
105
|
if (t && _.label < t[2]) {
|
|
128
106
|
_.label = t[2];
|
|
129
|
-
|
|
130
107
|
_.ops.push(op);
|
|
131
|
-
|
|
132
108
|
break;
|
|
133
109
|
}
|
|
134
|
-
|
|
135
110
|
if (t[2]) _.ops.pop();
|
|
136
|
-
|
|
137
111
|
_.trys.pop();
|
|
138
|
-
|
|
139
112
|
continue;
|
|
140
113
|
}
|
|
141
|
-
|
|
142
114
|
op = body.call(thisArg, _);
|
|
143
115
|
} catch (e) {
|
|
144
116
|
op = [6, e];
|
|
@@ -146,7 +118,6 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
146
118
|
} finally {
|
|
147
119
|
f = t = 0;
|
|
148
120
|
}
|
|
149
|
-
|
|
150
121
|
if (op[0] & 5) throw op[1];
|
|
151
122
|
return {
|
|
152
123
|
value: op[0] ? op[1] : void 0,
|
|
@@ -154,15 +125,13 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
154
125
|
};
|
|
155
126
|
}
|
|
156
127
|
};
|
|
157
|
-
|
|
158
128
|
var __read = this && this.__read || function (o, n) {
|
|
159
129
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
160
130
|
if (!m) return o;
|
|
161
131
|
var i = m.call(o),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
132
|
+
r,
|
|
133
|
+
ar = [],
|
|
134
|
+
e;
|
|
166
135
|
try {
|
|
167
136
|
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
168
137
|
} catch (error) {
|
|
@@ -176,10 +145,8 @@ var __read = this && this.__read || function (o, n) {
|
|
|
176
145
|
if (e) throw e.error;
|
|
177
146
|
}
|
|
178
147
|
}
|
|
179
|
-
|
|
180
148
|
return ar;
|
|
181
149
|
};
|
|
182
|
-
|
|
183
150
|
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
184
151
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
185
152
|
if (ar || !(i in from)) {
|
|
@@ -189,20 +156,13 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
189
156
|
}
|
|
190
157
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
191
158
|
};
|
|
192
|
-
|
|
193
159
|
exports.__esModule = true;
|
|
194
160
|
exports.createChildPipeline = void 0;
|
|
195
|
-
|
|
196
161
|
var config_1 = require("../config");
|
|
197
|
-
|
|
198
162
|
var rules_1 = require("../rules");
|
|
199
|
-
|
|
200
163
|
var runner_1 = require("../runner");
|
|
201
|
-
|
|
202
164
|
var jobs_1 = require("../types/jobs");
|
|
203
|
-
|
|
204
165
|
var createJobs_1 = require("./createJobs");
|
|
205
|
-
|
|
206
166
|
var createChildPipeline = function (type, trigger, config) {
|
|
207
167
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
208
168
|
var components, jobs, allEnvs, stages, pipeline;
|
|
@@ -210,36 +170,24 @@ var createChildPipeline = function (type, trigger, config) {
|
|
|
210
170
|
switch (_a.label) {
|
|
211
171
|
case 0:
|
|
212
172
|
components = Object.keys(config.components);
|
|
213
|
-
return [4
|
|
214
|
-
/*yield*/
|
|
215
|
-
, components.reduce(function (acc, componentName) {
|
|
173
|
+
return [4 /*yield*/, components.reduce(function (acc, componentName) {
|
|
216
174
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
217
175
|
var envs, _a, _b;
|
|
218
|
-
|
|
219
176
|
return __generator(this, function (_c) {
|
|
220
177
|
switch (_c.label) {
|
|
221
178
|
case 0:
|
|
222
179
|
envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
|
|
223
180
|
_a = [{}];
|
|
224
|
-
return [4
|
|
225
|
-
/*yield*/
|
|
226
|
-
, acc];
|
|
227
|
-
|
|
181
|
+
return [4 /*yield*/, acc];
|
|
228
182
|
case 1:
|
|
229
183
|
_b = [__assign.apply(void 0, _a.concat([_c.sent()]))];
|
|
230
|
-
return [4
|
|
231
|
-
/*yield*/
|
|
232
|
-
, (0, createJobs_1.createJobs)(type, envs, config, componentName, trigger)];
|
|
233
|
-
|
|
184
|
+
return [4 /*yield*/, (0, createJobs_1.createJobs)(type, envs, config, componentName, trigger)];
|
|
234
185
|
case 2:
|
|
235
|
-
return [2
|
|
236
|
-
/*return*/
|
|
237
|
-
, __assign.apply(void 0, _b.concat([_c.sent()]))];
|
|
186
|
+
return [2 /*return*/, __assign.apply(void 0, _b.concat([_c.sent()]))];
|
|
238
187
|
}
|
|
239
188
|
});
|
|
240
189
|
});
|
|
241
190
|
}, Promise.resolve({}))];
|
|
242
|
-
|
|
243
191
|
case 1:
|
|
244
192
|
jobs = _a.sent();
|
|
245
193
|
allEnvs = (0, config_1.getAllEnvsInAllComponents)(config);
|
|
@@ -248,7 +196,6 @@ var createChildPipeline = function (type, trigger, config) {
|
|
|
248
196
|
return "".concat(baseStage, " ").concat(e);
|
|
249
197
|
})), false);
|
|
250
198
|
}, []);
|
|
251
|
-
|
|
252
199
|
if (type === "gitlab") {
|
|
253
200
|
pipeline = {
|
|
254
201
|
image: (0, runner_1.getRunnerImage)("jobs-default"),
|
|
@@ -261,15 +208,11 @@ var createChildPipeline = function (type, trigger, config) {
|
|
|
261
208
|
stages: stages,
|
|
262
209
|
jobs: jobs
|
|
263
210
|
};
|
|
264
|
-
return [2
|
|
265
|
-
/*return*/
|
|
266
|
-
, pipeline];
|
|
211
|
+
return [2 /*return*/, pipeline];
|
|
267
212
|
}
|
|
268
|
-
|
|
269
213
|
throw new Error("".concat(type, " is not supported"));
|
|
270
214
|
}
|
|
271
215
|
});
|
|
272
216
|
});
|
|
273
217
|
};
|
|
274
|
-
|
|
275
218
|
exports.createChildPipeline = createChildPipeline;
|