@catladder/pipeline 4.1.0 → 4.2.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/artifacts/createBuildJobArtifact.d.ts +1 -1
- package/dist/build/artifacts/createBuildJobArtifact.js +193 -30
- package/dist/build/base/createAppBuildJob.d.ts +1 -1
- package/dist/build/base/createAppBuildJob.js +149 -22
- package/dist/build/base/index.d.ts +2 -2
- package/dist/build/base/index.js +159 -9
- package/dist/build/custom/buildJob.d.ts +1 -1
- package/dist/build/custom/buildJob.js +130 -10
- package/dist/build/custom/index.d.ts +1 -1
- package/dist/build/custom/index.js +127 -1
- package/dist/build/rails/build.d.ts +1 -1
- package/dist/build/rails/build.js +153 -33
- package/dist/build/rails/index.d.ts +1 -1
- package/dist/build/rails/index.js +127 -1
- package/dist/constants.js +1 -1
- package/dist/context/createComponentContext.js +27 -9
- package/dist/context/createWorkspaceContext.js +15 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/context.d.ts +1 -1
- package/package.json +1 -1
- package/src/build/artifacts/createBuildJobArtifact.ts +28 -21
- package/src/build/base/createAppBuildJob.ts +3 -3
- package/src/build/base/index.ts +6 -6
- package/src/build/custom/buildJob.ts +2 -2
- package/src/build/custom/index.ts +6 -3
- package/src/build/rails/build.ts +2 -2
- package/src/build/rails/index.ts +6 -3
- package/src/context/createComponentContext.ts +3 -6
- package/src/context/createWorkspaceContext.ts +8 -2
- package/src/types/context.ts +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Context } from "../../types";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
export declare const createBuildJobArtifacts: (context: Context) => CatladderJob["artifacts"]
|
|
3
|
+
export declare const createBuildJobArtifacts: (context: Context) => Promise<CatladderJob["artifacts"]>;
|
|
@@ -10,6 +10,121 @@ var __assign = this && this.__assign || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) {
|
|
15
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
16
|
+
resolve(value);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function rejected(value) {
|
|
28
|
+
try {
|
|
29
|
+
step(generator["throw"](value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function step(result) {
|
|
35
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
36
|
+
}
|
|
37
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
41
|
+
var _ = {
|
|
42
|
+
label: 0,
|
|
43
|
+
sent: function () {
|
|
44
|
+
if (t[0] & 1) throw t[1];
|
|
45
|
+
return t[1];
|
|
46
|
+
},
|
|
47
|
+
trys: [],
|
|
48
|
+
ops: []
|
|
49
|
+
},
|
|
50
|
+
f,
|
|
51
|
+
y,
|
|
52
|
+
t,
|
|
53
|
+
g;
|
|
54
|
+
return g = {
|
|
55
|
+
next: verb(0),
|
|
56
|
+
"throw": verb(1),
|
|
57
|
+
"return": verb(2)
|
|
58
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
59
|
+
return this;
|
|
60
|
+
}), g;
|
|
61
|
+
function verb(n) {
|
|
62
|
+
return function (v) {
|
|
63
|
+
return step([n, v]);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function step(op) {
|
|
67
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
68
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
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;
|
|
70
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
71
|
+
switch (op[0]) {
|
|
72
|
+
case 0:
|
|
73
|
+
case 1:
|
|
74
|
+
t = op;
|
|
75
|
+
break;
|
|
76
|
+
case 4:
|
|
77
|
+
_.label++;
|
|
78
|
+
return {
|
|
79
|
+
value: op[1],
|
|
80
|
+
done: false
|
|
81
|
+
};
|
|
82
|
+
case 5:
|
|
83
|
+
_.label++;
|
|
84
|
+
y = op[1];
|
|
85
|
+
op = [0];
|
|
86
|
+
continue;
|
|
87
|
+
case 7:
|
|
88
|
+
op = _.ops.pop();
|
|
89
|
+
_.trys.pop();
|
|
90
|
+
continue;
|
|
91
|
+
default:
|
|
92
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
93
|
+
_ = 0;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
97
|
+
_.label = op[1];
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
101
|
+
_.label = t[1];
|
|
102
|
+
t = op;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (t && _.label < t[2]) {
|
|
106
|
+
_.label = t[2];
|
|
107
|
+
_.ops.push(op);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (t[2]) _.ops.pop();
|
|
111
|
+
_.trys.pop();
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
op = body.call(thisArg, _);
|
|
115
|
+
} catch (e) {
|
|
116
|
+
op = [6, e];
|
|
117
|
+
y = 0;
|
|
118
|
+
} finally {
|
|
119
|
+
f = t = 0;
|
|
120
|
+
}
|
|
121
|
+
if (op[0] & 5) throw op[1];
|
|
122
|
+
return {
|
|
123
|
+
value: op[0] ? op[1] : void 0,
|
|
124
|
+
done: true
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
};
|
|
13
128
|
var __read = this && this.__read || function (o, n) {
|
|
14
129
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
130
|
if (!m) return o;
|
|
@@ -55,39 +170,76 @@ var uniqueAndAlphabeticalSort = function (arr) {
|
|
|
55
170
|
});
|
|
56
171
|
};
|
|
57
172
|
var createBuildJobArtifacts = function (context) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
173
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
174
|
+
var paths, _a, exclude, _b;
|
|
175
|
+
var _c, _d;
|
|
176
|
+
return __generator(this, function (_e) {
|
|
177
|
+
switch (_e.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
if (!(context.type === "workspace")) return [3 /*break*/, 2];
|
|
180
|
+
return [4 /*yield*/, Promise.all(context.components.map(function (c) {
|
|
181
|
+
return getArtifactsPathForComponent(c);
|
|
182
|
+
}))];
|
|
183
|
+
case 1:
|
|
184
|
+
_a = _e.sent().flat();
|
|
185
|
+
return [3 /*break*/, 4];
|
|
186
|
+
case 2:
|
|
187
|
+
return [4 /*yield*/, getArtifactsPathForComponent(context, ["__build_info.json"])];
|
|
188
|
+
case 3:
|
|
189
|
+
_a = _e.sent();
|
|
190
|
+
_e.label = 4;
|
|
191
|
+
case 4:
|
|
192
|
+
paths = _a;
|
|
193
|
+
if (!(context.type === "workspace")) return [3 /*break*/, 6];
|
|
194
|
+
return [4 /*yield*/, Promise.all(context.components.map(function (c) {
|
|
195
|
+
return getAllArtifactExcludePathsForComponent(c);
|
|
196
|
+
}))];
|
|
197
|
+
case 5:
|
|
198
|
+
_b = _e.sent().flat();
|
|
199
|
+
return [3 /*break*/, 8];
|
|
200
|
+
case 6:
|
|
201
|
+
return [4 /*yield*/, getAllArtifactExcludePathsForComponent(context)];
|
|
202
|
+
case 7:
|
|
203
|
+
_b = _e.sent();
|
|
204
|
+
_e.label = 8;
|
|
205
|
+
case 8:
|
|
206
|
+
exclude = _b;
|
|
207
|
+
return [2 /*return*/, __assign(__assign({
|
|
208
|
+
paths: uniqueAndAlphabeticalSort(paths)
|
|
209
|
+
}, exclude.length > 0 ? {
|
|
210
|
+
exclude: uniqueAndAlphabeticalSort(exclude)
|
|
211
|
+
} : {}), {
|
|
212
|
+
expire_in: "1 day",
|
|
213
|
+
when: "always",
|
|
214
|
+
reports:
|
|
215
|
+
// TODO: support for junit reports in other builds
|
|
216
|
+
context.type === "component" && (0, types_1.componentContextIsStandaloneBuild)(context) ? {
|
|
217
|
+
junit: (_d = (_c = context.build.config.artifactsReports) === null || _c === void 0 ? void 0 : _c.junit) === null || _d === void 0 ? void 0 : _d.map(function (p) {
|
|
218
|
+
return (0, path_1.join)(context.build.dir, p);
|
|
219
|
+
})
|
|
220
|
+
} : {}
|
|
221
|
+
})];
|
|
222
|
+
}
|
|
223
|
+
});
|
|
79
224
|
});
|
|
80
225
|
};
|
|
81
226
|
exports.createBuildJobArtifacts = createBuildJobArtifacts;
|
|
82
227
|
var _getArtifactPathsForComponent = function (c, configKey, additionalPaths) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
228
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
229
|
+
var componentDirs;
|
|
230
|
+
var _a, _b;
|
|
231
|
+
return __generator(this, function (_c) {
|
|
232
|
+
switch (_c.label) {
|
|
233
|
+
case 0:
|
|
234
|
+
return [4 /*yield*/, c.build.getComponentDirs("all")];
|
|
235
|
+
case 1:
|
|
236
|
+
componentDirs = _c.sent();
|
|
237
|
+
return [2 /*return*/, (_b = __spreadArray(__spreadArray([], __read(c.build.type !== "disabled" ? (_a = c.build.config[configKey]) !== null && _a !== void 0 ? _a : [] : []), false), __read(additionalPaths !== null && additionalPaths !== void 0 ? additionalPaths : []), false)) === null || _b === void 0 ? void 0 : _b.flatMap(function (artifact) {
|
|
238
|
+
return componentDirs.flatMap(function (cDir) {
|
|
239
|
+
return (0, path_1.join)(cDir, artifact);
|
|
240
|
+
});
|
|
241
|
+
})];
|
|
242
|
+
}
|
|
91
243
|
});
|
|
92
244
|
});
|
|
93
245
|
};
|
|
@@ -95,7 +247,18 @@ var getArtifactsPathForComponent = function (c, additionalPaths) {
|
|
|
95
247
|
return _getArtifactPathsForComponent(c, "artifactsPaths", additionalPaths);
|
|
96
248
|
};
|
|
97
249
|
var getAllArtifactExcludePathsForComponent = function (c) {
|
|
98
|
-
return
|
|
250
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
251
|
+
var _a;
|
|
252
|
+
return __generator(this, function (_b) {
|
|
253
|
+
switch (_b.label) {
|
|
254
|
+
case 0:
|
|
255
|
+
_a = [__spreadArray([], __read(getDotEnvPathsForComponent(c)), false)];
|
|
256
|
+
return [4 /*yield*/, getArtifactExcludePathsForComponent(c)];
|
|
257
|
+
case 1:
|
|
258
|
+
return [2 /*return*/, __spreadArray.apply(void 0, _a.concat([__read.apply(void 0, [_b.sent()]), false]))];
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
});
|
|
99
262
|
};
|
|
100
263
|
var getArtifactExcludePathsForComponent = function (c, additionalPaths) {
|
|
101
264
|
return _getArtifactPathsForComponent(c, "artifactsExcludePaths", additionalPaths);
|
|
@@ -10,6 +10,121 @@ var __assign = this && this.__assign || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) {
|
|
15
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
16
|
+
resolve(value);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function rejected(value) {
|
|
28
|
+
try {
|
|
29
|
+
step(generator["throw"](value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function step(result) {
|
|
35
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
36
|
+
}
|
|
37
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
41
|
+
var _ = {
|
|
42
|
+
label: 0,
|
|
43
|
+
sent: function () {
|
|
44
|
+
if (t[0] & 1) throw t[1];
|
|
45
|
+
return t[1];
|
|
46
|
+
},
|
|
47
|
+
trys: [],
|
|
48
|
+
ops: []
|
|
49
|
+
},
|
|
50
|
+
f,
|
|
51
|
+
y,
|
|
52
|
+
t,
|
|
53
|
+
g;
|
|
54
|
+
return g = {
|
|
55
|
+
next: verb(0),
|
|
56
|
+
"throw": verb(1),
|
|
57
|
+
"return": verb(2)
|
|
58
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
59
|
+
return this;
|
|
60
|
+
}), g;
|
|
61
|
+
function verb(n) {
|
|
62
|
+
return function (v) {
|
|
63
|
+
return step([n, v]);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function step(op) {
|
|
67
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
68
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
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;
|
|
70
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
71
|
+
switch (op[0]) {
|
|
72
|
+
case 0:
|
|
73
|
+
case 1:
|
|
74
|
+
t = op;
|
|
75
|
+
break;
|
|
76
|
+
case 4:
|
|
77
|
+
_.label++;
|
|
78
|
+
return {
|
|
79
|
+
value: op[1],
|
|
80
|
+
done: false
|
|
81
|
+
};
|
|
82
|
+
case 5:
|
|
83
|
+
_.label++;
|
|
84
|
+
y = op[1];
|
|
85
|
+
op = [0];
|
|
86
|
+
continue;
|
|
87
|
+
case 7:
|
|
88
|
+
op = _.ops.pop();
|
|
89
|
+
_.trys.pop();
|
|
90
|
+
continue;
|
|
91
|
+
default:
|
|
92
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
93
|
+
_ = 0;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
97
|
+
_.label = op[1];
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
101
|
+
_.label = t[1];
|
|
102
|
+
t = op;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (t && _.label < t[2]) {
|
|
106
|
+
_.label = t[2];
|
|
107
|
+
_.ops.push(op);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (t[2]) _.ops.pop();
|
|
111
|
+
_.trys.pop();
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
op = body.call(thisArg, _);
|
|
115
|
+
} catch (e) {
|
|
116
|
+
op = [6, e];
|
|
117
|
+
y = 0;
|
|
118
|
+
} finally {
|
|
119
|
+
f = t = 0;
|
|
120
|
+
}
|
|
121
|
+
if (op[0] & 5) throw op[1];
|
|
122
|
+
return {
|
|
123
|
+
value: op[0] ? op[1] : void 0,
|
|
124
|
+
done: true
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
};
|
|
13
128
|
var __rest = this && this.__rest || function (s, e) {
|
|
14
129
|
var t = {};
|
|
15
130
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -63,27 +178,39 @@ var constants_1 = require("./constants");
|
|
|
63
178
|
var writeBuildInfo_1 = require("./writeBuildInfo");
|
|
64
179
|
var writeDotEnv_1 = require("./writeDotEnv");
|
|
65
180
|
var createAppBuildJob = function (context, _a) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
181
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
182
|
+
var _b;
|
|
183
|
+
var _c;
|
|
184
|
+
var _d;
|
|
185
|
+
var script = _a.script,
|
|
186
|
+
variables = _a.variables,
|
|
187
|
+
runnerVariables = _a.runnerVariables,
|
|
188
|
+
cache = _a.cache,
|
|
189
|
+
def = __rest(_a, ["script", "variables", "runnerVariables", "cache"]);
|
|
190
|
+
return __generator(this, function (_e) {
|
|
191
|
+
switch (_e.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
_b = lodash_1.merge;
|
|
194
|
+
_c = {
|
|
195
|
+
name: constants_1.APP_BUILD_JOB_NAME,
|
|
196
|
+
envMode: "jobPerEnv",
|
|
197
|
+
stage: "build",
|
|
198
|
+
image: (0, __1.getRunnerImage)("jobs-default"),
|
|
199
|
+
needs: [],
|
|
200
|
+
cache: cache ? (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, cache) : undefined,
|
|
201
|
+
variables: __assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.type === "component" ? __assign(__assign({}, context.environment.envVars), context.environment.jobOnlyVars.build.envVars) : {}),
|
|
202
|
+
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {}), (_d = context.build.config.runnerVariables) !== null && _d !== void 0 ? _d : {}),
|
|
203
|
+
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) {
|
|
204
|
+
return (0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(c);
|
|
205
|
+
}).flatMap(function (c) {
|
|
206
|
+
return (0, writeDotEnv_1.writeDotEnv)(c);
|
|
207
|
+
}) : []), false), __read(context.type === "component" ? (0, writeBuildInfo_1.writeBuildInfo)(context) : []), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.build.dir)], false), __read((0, utils_1.ensureArray)(script)), false)
|
|
208
|
+
};
|
|
209
|
+
return [4 /*yield*/, (0, createBuildJobArtifact_1.createBuildJobArtifacts)(context)];
|
|
210
|
+
case 1:
|
|
211
|
+
return [2 /*return*/, _b.apply(void 0, [(_c.artifacts = _e.sent(), _c), def])];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
88
215
|
};
|
|
89
216
|
exports.createAppBuildJob = createAppBuildJob;
|
|
@@ -4,7 +4,7 @@ import type { CatladderJob } from "../../types/jobs";
|
|
|
4
4
|
export declare const createComponentBuildJobs: (context: ComponentContextWithBuild, definitions: {
|
|
5
5
|
appBuild?: AppBuildJobDefinition;
|
|
6
6
|
dockerBuild: DockerBuildJobDefinition;
|
|
7
|
-
}) => CatladderJob[]
|
|
7
|
+
}) => Promise<CatladderJob[]>;
|
|
8
8
|
export declare const createWorkspaceBuildJobs: (context: WorkspaceContext, definitions: {
|
|
9
9
|
appBuild?: AppBuildJobDefinition;
|
|
10
|
-
}) => CatladderJob[]
|
|
10
|
+
}) => Promise<CatladderJob[]>;
|
package/dist/build/base/index.js
CHANGED
|
@@ -10,6 +10,121 @@ var __assign = this && this.__assign || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) {
|
|
15
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
16
|
+
resolve(value);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function rejected(value) {
|
|
28
|
+
try {
|
|
29
|
+
step(generator["throw"](value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function step(result) {
|
|
35
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
36
|
+
}
|
|
37
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
41
|
+
var _ = {
|
|
42
|
+
label: 0,
|
|
43
|
+
sent: function () {
|
|
44
|
+
if (t[0] & 1) throw t[1];
|
|
45
|
+
return t[1];
|
|
46
|
+
},
|
|
47
|
+
trys: [],
|
|
48
|
+
ops: []
|
|
49
|
+
},
|
|
50
|
+
f,
|
|
51
|
+
y,
|
|
52
|
+
t,
|
|
53
|
+
g;
|
|
54
|
+
return g = {
|
|
55
|
+
next: verb(0),
|
|
56
|
+
"throw": verb(1),
|
|
57
|
+
"return": verb(2)
|
|
58
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
59
|
+
return this;
|
|
60
|
+
}), g;
|
|
61
|
+
function verb(n) {
|
|
62
|
+
return function (v) {
|
|
63
|
+
return step([n, v]);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function step(op) {
|
|
67
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
68
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
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;
|
|
70
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
71
|
+
switch (op[0]) {
|
|
72
|
+
case 0:
|
|
73
|
+
case 1:
|
|
74
|
+
t = op;
|
|
75
|
+
break;
|
|
76
|
+
case 4:
|
|
77
|
+
_.label++;
|
|
78
|
+
return {
|
|
79
|
+
value: op[1],
|
|
80
|
+
done: false
|
|
81
|
+
};
|
|
82
|
+
case 5:
|
|
83
|
+
_.label++;
|
|
84
|
+
y = op[1];
|
|
85
|
+
op = [0];
|
|
86
|
+
continue;
|
|
87
|
+
case 7:
|
|
88
|
+
op = _.ops.pop();
|
|
89
|
+
_.trys.pop();
|
|
90
|
+
continue;
|
|
91
|
+
default:
|
|
92
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
93
|
+
_ = 0;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
97
|
+
_.label = op[1];
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
101
|
+
_.label = t[1];
|
|
102
|
+
t = op;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (t && _.label < t[2]) {
|
|
106
|
+
_.label = t[2];
|
|
107
|
+
_.ops.push(op);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (t[2]) _.ops.pop();
|
|
111
|
+
_.trys.pop();
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
op = body.call(thisArg, _);
|
|
115
|
+
} catch (e) {
|
|
116
|
+
op = [6, e];
|
|
117
|
+
y = 0;
|
|
118
|
+
} finally {
|
|
119
|
+
f = t = 0;
|
|
120
|
+
}
|
|
121
|
+
if (op[0] & 5) throw op[1];
|
|
122
|
+
return {
|
|
123
|
+
value: op[0] ? op[1] : void 0,
|
|
124
|
+
done: true
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
};
|
|
13
128
|
var __read = this && this.__read || function (o, n) {
|
|
14
129
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
130
|
if (!m) return o;
|
|
@@ -50,17 +165,52 @@ var docker_1 = require("../docker");
|
|
|
50
165
|
var constants_1 = require("./constants");
|
|
51
166
|
var createAppBuildJob_1 = require("./createAppBuildJob");
|
|
52
167
|
var createComponentBuildJobs = function (context, definitions) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
168
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
var _c;
|
|
171
|
+
return __generator(this, function (_d) {
|
|
172
|
+
switch (_d.label) {
|
|
173
|
+
case 0:
|
|
174
|
+
_a = [[]];
|
|
175
|
+
if (!(definitions.appBuild && (0, context_1.componentContextIsStandaloneBuild)(context))) return [3 /*break*/, 2];
|
|
176
|
+
return [4 /*yield*/, (0, createAppBuildJob_1.createAppBuildJob)(context, definitions.appBuild)];
|
|
177
|
+
case 1:
|
|
178
|
+
_b = [_d.sent()];
|
|
179
|
+
return [3 /*break*/, 3];
|
|
180
|
+
case 2:
|
|
181
|
+
_b = [];
|
|
182
|
+
_d.label = 3;
|
|
183
|
+
case 3:
|
|
184
|
+
return [2 /*return*/, __spreadArray.apply(void 0, [__spreadArray.apply(void 0, _a.concat([__read.apply(void 0, [_b]), false])), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobBase)(context, __assign(__assign({}, definitions.dockerBuild), {
|
|
185
|
+
needs: __spreadArray(__spreadArray([], __read((_c = definitions.dockerBuild.needs) !== null && _c !== void 0 ? _c : []), false), __read(definitions.appBuild && (0, context_1.componentContextIsStandaloneBuild)(context) ? [constants_1.APP_BUILD_JOB_NAME] : (0, context_1.componentContextHasWorkspaceBuild)(context) ? [{
|
|
186
|
+
job: constants_1.APP_BUILD_JOB_NAME,
|
|
187
|
+
artifacts: true,
|
|
188
|
+
workspaceName: context.build.workspaceName
|
|
189
|
+
}] : []), false)
|
|
190
|
+
}))] : []), false])];
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
});
|
|
61
194
|
};
|
|
62
195
|
exports.createComponentBuildJobs = createComponentBuildJobs;
|
|
63
196
|
var createWorkspaceBuildJobs = function (context, definitions) {
|
|
64
|
-
return
|
|
197
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
198
|
+
var _a;
|
|
199
|
+
return __generator(this, function (_b) {
|
|
200
|
+
switch (_b.label) {
|
|
201
|
+
case 0:
|
|
202
|
+
if (!definitions.appBuild) return [3 /*break*/, 2];
|
|
203
|
+
return [4 /*yield*/, (0, createAppBuildJob_1.createAppBuildJob)(context, definitions.appBuild)];
|
|
204
|
+
case 1:
|
|
205
|
+
_a = [_b.sent()];
|
|
206
|
+
return [3 /*break*/, 3];
|
|
207
|
+
case 2:
|
|
208
|
+
_a = [];
|
|
209
|
+
_b.label = 3;
|
|
210
|
+
case 3:
|
|
211
|
+
return [2 /*return*/, _a];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
65
215
|
};
|
|
66
216
|
exports.createWorkspaceBuildJobs = createWorkspaceBuildJobs;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ComponentContextWithBuild } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
export declare const createCustomBuildJobs: (context: ComponentContextWithBuild) => CatladderJob[]
|
|
3
|
+
export declare const createCustomBuildJobs: (context: ComponentContextWithBuild) => Promise<CatladderJob[]>;
|