@catladder/cli 0.0.0-next-b3e567e8 → 0.0.0-next-78f04d3f
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/apps/cli/src/catci.js +23 -0
- package/dist/apps/cli/src/catci.js.map +1 -1
- package/dist/apps/cli/src/release/githubQueuedRelease.d.ts +14 -0
- package/dist/apps/cli/src/release/githubQueuedRelease.js +152 -0
- package/dist/apps/cli/src/release/githubQueuedRelease.js.map +1 -0
- package/dist/bundles/catci/index.js +3 -3
- package/dist/bundles/catenv/index.js +516 -136
- package/dist/bundles/cli/index.js +516 -136
- package/dist/bundles/skills/catladder-builds/SKILL.md +49 -2
- package/dist/bundles/skills/catladder-builds/references/build-types.md +2 -2
- package/dist/bundles/skills/catladder-pipelines/SKILL.md +13 -3
- package/dist/bundles/skills/catladder-releases/SKILL.md +13 -2
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js +11 -4
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js.map +1 -1
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.d.ts +18 -2
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.js +92 -10
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.js.map +1 -1
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js +35 -9
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js.map +1 -1
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.d.ts +285 -3
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.js +142 -54
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.js.map +1 -1
- package/dist/packages/pipeline/src/build/types.d.ts +6 -5
- package/dist/packages/pipeline/src/build/types.js.map +1 -1
- package/dist/packages/pipeline/src/customImages/hash.d.ts +9 -0
- package/dist/packages/pipeline/src/customImages/hash.js +41 -16
- package/dist/packages/pipeline/src/customImages/hash.js.map +1 -1
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.d.ts +23 -5
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.js +177 -43
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.js.map +1 -1
- package/dist/packages/pipeline/src/customImages/projectImages.d.ts +67 -0
- package/dist/packages/pipeline/src/customImages/projectImages.js +9 -0
- package/dist/packages/pipeline/src/customImages/projectImages.js.map +1 -0
- package/dist/packages/pipeline/src/deploy/types/custom.d.ts +2 -2
- package/dist/packages/pipeline/src/deploy/types/index.d.ts +4 -4
- package/dist/packages/pipeline/src/deploy/types/pages.d.ts +2 -2
- package/dist/packages/pipeline/src/index.d.ts +2 -0
- package/dist/packages/pipeline/src/index.js +2 -0
- package/dist/packages/pipeline/src/index.js.map +1 -1
- package/dist/packages/pipeline/src/types/config.d.ts +8 -0
- package/dist/packages/pipeline/src/types/config.js.map +1 -1
- package/dist/packages/pipeline/src/types/github-types.d.ts +1 -0
- package/dist/packages/pipeline/src/types/jobs.d.ts +2 -1
- package/dist/packages/pipeline/src/types/jobs.js.map +1 -1
- package/dist/packages/pipeline/src/types/release.d.ts +7 -1
- package/dist/skills/catladder-builds/SKILL.md +49 -2
- package/dist/skills/catladder-builds/references/build-types.md +2 -2
- package/dist/skills/catladder-pipelines/SKILL.md +13 -3
- package/dist/skills/catladder-releases/SKILL.md +13 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/catci.ts +30 -0
- package/src/release/githubQueuedRelease.ts +173 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { JobImagesPlan } from "../../customImages/jobImagesPlan";
|
|
2
2
|
import type { Config } from "../../types/config";
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
3
|
+
export declare const RELEASE_BUTTON_JOB_NAME = "create release";
|
|
4
|
+
export declare const RELEASE_EXECUTOR_JOB_NAME = "\uD83D\uDE80 release once pipeline succeeds";
|
|
5
|
+
export declare const getGitlabReleaseJobs: (config: Config, images: JobImagesPlan, mainBranchJobNames: string[]) => {
|
|
6
|
+
"\uD83E\uDD8B changeset check": {
|
|
5
7
|
stage: string;
|
|
6
8
|
image: string;
|
|
7
9
|
script: string[];
|
|
8
|
-
allow_failure:
|
|
10
|
+
allow_failure: true;
|
|
9
11
|
artifacts: {
|
|
10
12
|
paths: string[];
|
|
11
13
|
expose_as: string;
|
|
@@ -22,11 +24,191 @@ export declare const getGitlabReleaseJobs: (config: Config, images: JobImagesPla
|
|
|
22
24
|
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
23
25
|
}[];
|
|
24
26
|
};
|
|
27
|
+
"\u26A0\uFE0F force create release": {
|
|
28
|
+
rules: {
|
|
29
|
+
if?: string;
|
|
30
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
31
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
32
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
33
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
34
|
+
start_in?: string;
|
|
35
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
36
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
37
|
+
}[];
|
|
38
|
+
variables?: Record<string, string>;
|
|
39
|
+
needs: any[];
|
|
40
|
+
allow_failure: true;
|
|
41
|
+
stage: string;
|
|
42
|
+
image: string;
|
|
43
|
+
script: string[];
|
|
44
|
+
after_script: string[];
|
|
45
|
+
};
|
|
46
|
+
"create release": {
|
|
47
|
+
rules: {
|
|
48
|
+
if?: string;
|
|
49
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
50
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
51
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
52
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
53
|
+
start_in?: string;
|
|
54
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
55
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
56
|
+
}[];
|
|
57
|
+
stage: string;
|
|
58
|
+
image: string;
|
|
59
|
+
script: string[];
|
|
60
|
+
after_script: string[];
|
|
61
|
+
needs?: undefined;
|
|
62
|
+
allow_failure?: undefined;
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
"\uD83E\uDD8B changeset check"?: undefined;
|
|
66
|
+
"\u26A0\uFE0F force create release": {
|
|
67
|
+
rules: {
|
|
68
|
+
if?: string;
|
|
69
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
70
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
71
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
72
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
73
|
+
start_in?: string;
|
|
74
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
75
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
76
|
+
}[];
|
|
77
|
+
variables?: Record<string, string>;
|
|
78
|
+
needs: any[];
|
|
79
|
+
allow_failure: true;
|
|
80
|
+
stage: string;
|
|
81
|
+
image: string;
|
|
82
|
+
script: string[];
|
|
83
|
+
after_script: string[];
|
|
84
|
+
};
|
|
85
|
+
"create release": {
|
|
86
|
+
rules: {
|
|
87
|
+
if?: string;
|
|
88
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
89
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
90
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
91
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
92
|
+
start_in?: string;
|
|
93
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
94
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
95
|
+
}[];
|
|
96
|
+
stage: string;
|
|
97
|
+
image: string;
|
|
98
|
+
script: string[];
|
|
99
|
+
after_script: string[];
|
|
100
|
+
needs?: undefined;
|
|
101
|
+
allow_failure?: undefined;
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
104
|
+
"\uD83E\uDD8B changeset check": {
|
|
105
|
+
stage: string;
|
|
106
|
+
image: string;
|
|
107
|
+
script: string[];
|
|
108
|
+
allow_failure: true;
|
|
109
|
+
artifacts: {
|
|
110
|
+
paths: string[];
|
|
111
|
+
expose_as: string;
|
|
112
|
+
when: "always";
|
|
113
|
+
};
|
|
114
|
+
rules: {
|
|
115
|
+
if?: string;
|
|
116
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
117
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
118
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
119
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
120
|
+
start_in?: string;
|
|
121
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
122
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
123
|
+
}[];
|
|
124
|
+
};
|
|
125
|
+
"\u26A0\uFE0F force create release": {
|
|
126
|
+
rules: {
|
|
127
|
+
if?: string;
|
|
128
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
129
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
130
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
131
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
132
|
+
start_in?: string;
|
|
133
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
134
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
135
|
+
}[];
|
|
136
|
+
variables?: Record<string, string>;
|
|
137
|
+
needs: any[];
|
|
138
|
+
allow_failure: true;
|
|
139
|
+
stage: string;
|
|
140
|
+
image: string;
|
|
141
|
+
script: string[];
|
|
142
|
+
after_script: string[];
|
|
143
|
+
};
|
|
144
|
+
"create release": {
|
|
145
|
+
allow_failure: true;
|
|
146
|
+
rules: {
|
|
147
|
+
if?: string;
|
|
148
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
149
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
150
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
151
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
152
|
+
start_in?: string;
|
|
153
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
154
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
155
|
+
}[];
|
|
156
|
+
stage: string;
|
|
157
|
+
image: string;
|
|
158
|
+
script: string[];
|
|
159
|
+
after_script: string[];
|
|
160
|
+
needs?: undefined;
|
|
161
|
+
};
|
|
162
|
+
} | {
|
|
163
|
+
"\uD83E\uDD8B changeset check"?: undefined;
|
|
164
|
+
"\u26A0\uFE0F force create release": {
|
|
165
|
+
rules: {
|
|
166
|
+
if?: string;
|
|
167
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
168
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
169
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
170
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
171
|
+
start_in?: string;
|
|
172
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
173
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
174
|
+
}[];
|
|
175
|
+
variables?: Record<string, string>;
|
|
176
|
+
needs: any[];
|
|
177
|
+
allow_failure: true;
|
|
178
|
+
stage: string;
|
|
179
|
+
image: string;
|
|
180
|
+
script: string[];
|
|
181
|
+
after_script: string[];
|
|
182
|
+
};
|
|
25
183
|
"create release": {
|
|
184
|
+
allow_failure: true;
|
|
185
|
+
rules: {
|
|
186
|
+
if?: string;
|
|
187
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
188
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
189
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
190
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
191
|
+
start_in?: string;
|
|
192
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
193
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
194
|
+
}[];
|
|
26
195
|
stage: string;
|
|
27
196
|
image: string;
|
|
28
197
|
script: string[];
|
|
29
198
|
after_script: string[];
|
|
199
|
+
needs?: undefined;
|
|
200
|
+
};
|
|
201
|
+
} | {
|
|
202
|
+
"\uD83E\uDD8B changeset check": {
|
|
203
|
+
stage: string;
|
|
204
|
+
image: string;
|
|
205
|
+
script: string[];
|
|
206
|
+
allow_failure: true;
|
|
207
|
+
artifacts: {
|
|
208
|
+
paths: string[];
|
|
209
|
+
expose_as: string;
|
|
210
|
+
when: "always";
|
|
211
|
+
};
|
|
30
212
|
rules: {
|
|
31
213
|
if?: string;
|
|
32
214
|
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
@@ -50,10 +232,110 @@ export declare const getGitlabReleaseJobs: (config: Config, images: JobImagesPla
|
|
|
50
232
|
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
51
233
|
}[];
|
|
52
234
|
variables?: Record<string, string>;
|
|
235
|
+
needs: any[];
|
|
236
|
+
allow_failure: true;
|
|
53
237
|
stage: string;
|
|
54
238
|
image: string;
|
|
55
239
|
script: string[];
|
|
56
240
|
after_script: string[];
|
|
241
|
+
};
|
|
242
|
+
"create release": {
|
|
243
|
+
stage: string;
|
|
244
|
+
image: string;
|
|
245
|
+
script: string[];
|
|
57
246
|
needs: any[];
|
|
247
|
+
allow_failure: true;
|
|
248
|
+
rules: {
|
|
249
|
+
if?: string;
|
|
250
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
251
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
252
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
253
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
254
|
+
start_in?: string;
|
|
255
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
256
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
257
|
+
}[];
|
|
258
|
+
};
|
|
259
|
+
"\uD83D\uDE80 release once pipeline succeeds": {
|
|
260
|
+
needs: ({
|
|
261
|
+
job: string;
|
|
262
|
+
optional: boolean;
|
|
263
|
+
} | {
|
|
264
|
+
job: string;
|
|
265
|
+
})[];
|
|
266
|
+
rules: {
|
|
267
|
+
if?: string;
|
|
268
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
269
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
270
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
271
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
272
|
+
start_in?: string;
|
|
273
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
274
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
275
|
+
}[];
|
|
276
|
+
stage: string;
|
|
277
|
+
image: string;
|
|
278
|
+
script: string[];
|
|
279
|
+
after_script: string[];
|
|
280
|
+
};
|
|
281
|
+
} | {
|
|
282
|
+
"\uD83E\uDD8B changeset check"?: undefined;
|
|
283
|
+
"\u26A0\uFE0F force create release": {
|
|
284
|
+
rules: {
|
|
285
|
+
if?: string;
|
|
286
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
287
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
288
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
289
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
290
|
+
start_in?: string;
|
|
291
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
292
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
293
|
+
}[];
|
|
294
|
+
variables?: Record<string, string>;
|
|
295
|
+
needs: any[];
|
|
296
|
+
allow_failure: true;
|
|
297
|
+
stage: string;
|
|
298
|
+
image: string;
|
|
299
|
+
script: string[];
|
|
300
|
+
after_script: string[];
|
|
301
|
+
};
|
|
302
|
+
"create release": {
|
|
303
|
+
stage: string;
|
|
304
|
+
image: string;
|
|
305
|
+
script: string[];
|
|
306
|
+
needs: any[];
|
|
307
|
+
allow_failure: true;
|
|
308
|
+
rules: {
|
|
309
|
+
if?: string;
|
|
310
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
311
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
312
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
313
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
314
|
+
start_in?: string;
|
|
315
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
316
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
317
|
+
}[];
|
|
318
|
+
};
|
|
319
|
+
"\uD83D\uDE80 release once pipeline succeeds": {
|
|
320
|
+
needs: ({
|
|
321
|
+
job: string;
|
|
322
|
+
optional: boolean;
|
|
323
|
+
} | {
|
|
324
|
+
job: string;
|
|
325
|
+
})[];
|
|
326
|
+
rules: {
|
|
327
|
+
if?: string;
|
|
328
|
+
changes?: import("../../types/gitlab-ci-yml").Changes;
|
|
329
|
+
exists?: import("../../types/gitlab-ci-yml").Exists;
|
|
330
|
+
variables?: import("../../types/gitlab-ci-yml").RulesVariables;
|
|
331
|
+
when?: import("../../types/gitlab-ci-yml").When;
|
|
332
|
+
start_in?: string;
|
|
333
|
+
allow_failure?: import("../../types/gitlab-ci-yml").AllowFailure;
|
|
334
|
+
needs?: import("../../types/gitlab-ci-yml").RulesNeeds;
|
|
335
|
+
}[];
|
|
336
|
+
stage: string;
|
|
337
|
+
image: string;
|
|
338
|
+
script: string[];
|
|
339
|
+
after_script: string[];
|
|
58
340
|
};
|
|
59
341
|
};
|
|
@@ -1,90 +1,178 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGitlabReleaseJobs = void 0;
|
|
3
|
+
exports.getGitlabReleaseJobs = exports.RELEASE_EXECUTOR_JOB_NAME = exports.RELEASE_BUTTON_JOB_NAME = void 0;
|
|
4
4
|
const rules_1 = require("../../rules");
|
|
5
5
|
const release_1 = require("../../release");
|
|
6
6
|
const EXPIRED_TOKEN_HELP = "echo '👉 If this job failed with access denied, the project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";
|
|
7
|
+
/**
|
|
8
|
+
* gitlab rejects jobs with more than 50 `needs:` entries (default
|
|
9
|
+
* limit). Pipelines beyond that fall back to the legacy manual release
|
|
10
|
+
* job, which is only playable once all prior stages finished.
|
|
11
|
+
*/
|
|
12
|
+
const GITLAB_MAX_NEEDS = 50;
|
|
13
|
+
exports.RELEASE_BUTTON_JOB_NAME = "create release";
|
|
14
|
+
exports.RELEASE_EXECUTOR_JOB_NAME = "🚀 release once pipeline succeeds";
|
|
7
15
|
const baseReleaseRules = [
|
|
8
16
|
rules_1.RULE_NEVER_ON_RELEASE_COMMIT,
|
|
9
17
|
rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
|
|
10
18
|
rules_1.RULE_NEVER_ON_SCHEDULE,
|
|
11
19
|
];
|
|
12
|
-
|
|
20
|
+
// NOTE: with `rules:`, when: manual defaults to allow_failure: false,
|
|
21
|
+
// which turns every unclicked pipeline into status "blocked" — the
|
|
22
|
+
// manual release jobs therefore carry allow_failure: true so pipelines
|
|
23
|
+
// end "passed" when nobody releases
|
|
24
|
+
const manualReleaseRules = [
|
|
25
|
+
...baseReleaseRules,
|
|
26
|
+
{
|
|
27
|
+
if: rules_1.RULE_CONDITION_MAIN_BRANCH,
|
|
28
|
+
when: "manual",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
|
|
32
|
+
when: "manual",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
const getGitlabReleaseJobs = (config, images,
|
|
36
|
+
/**
|
|
37
|
+
* names of the jobs that run automatically in main-branch pipelines
|
|
38
|
+
* (manual jobs excluded: a needed-but-unplayed manual job would make
|
|
39
|
+
* gitlab skip the release executor)
|
|
40
|
+
*/
|
|
41
|
+
mainBranchJobNames) => {
|
|
13
42
|
var _a;
|
|
14
43
|
const method = (0, release_1.getReleaseMethod)(config);
|
|
15
44
|
// NOTE: only the resolved image url is used, not the `need`: release
|
|
16
|
-
// jobs have no `needs` on purpose —
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// longer wait for the build/deploy stages.
|
|
45
|
+
// jobs have no `needs` on the whole pipeline on purpose — where they
|
|
46
|
+
// must wait for it, the wait is expressed by enumerating the jobs
|
|
47
|
+
// explicitly (see the executor below).
|
|
20
48
|
const releaseImage = images.resolveRef({
|
|
21
49
|
catladderImage: method.image,
|
|
22
50
|
}).image;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
...baseReleaseRules,
|
|
31
|
-
{
|
|
32
|
-
if: rules_1.RULE_CONDITION_MAIN_BRANCH,
|
|
33
|
-
when: ((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto" ? "on_success" : "manual",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
|
|
37
|
-
when: "manual",
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
51
|
+
const releaseJobBase = {
|
|
52
|
+
stage: "release",
|
|
53
|
+
image: releaseImage,
|
|
54
|
+
script: [method.script],
|
|
55
|
+
after_script: [EXPIRED_TOKEN_HELP],
|
|
56
|
+
};
|
|
57
|
+
const forceReleaseJob = {
|
|
41
58
|
["⚠️ force create release"]: {
|
|
42
|
-
|
|
43
|
-
image: releaseImage,
|
|
44
|
-
script: [method.script],
|
|
45
|
-
after_script: [EXPIRED_TOKEN_HELP],
|
|
59
|
+
...releaseJobBase,
|
|
46
60
|
needs: [],
|
|
61
|
+
allow_failure: true,
|
|
47
62
|
// force semantics of the method's script (e.g. changesets:
|
|
48
63
|
// release a patch bump even without pending changesets)
|
|
49
64
|
...(method.forceReleaseVariables
|
|
50
65
|
? { variables: method.forceReleaseVariables }
|
|
51
66
|
: {}),
|
|
67
|
+
rules: manualReleaseRules,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
// informational MR check of the release method (e.g. the changeset
|
|
71
|
+
// check): warns via allow_failure, the report lands in the MR
|
|
72
|
+
// widget as an exposed artifact
|
|
73
|
+
const checkJob = method.checkScript
|
|
74
|
+
? {
|
|
75
|
+
["🦋 changeset check"]: {
|
|
76
|
+
stage: "test",
|
|
77
|
+
image: releaseImage,
|
|
78
|
+
script: [method.checkScript],
|
|
79
|
+
allow_failure: true,
|
|
80
|
+
artifacts: {
|
|
81
|
+
paths: ["changeset-report.md"],
|
|
82
|
+
expose_as: "changeset report",
|
|
83
|
+
// the report must survive the warning exit
|
|
84
|
+
when: "always",
|
|
85
|
+
},
|
|
86
|
+
rules: [
|
|
87
|
+
rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
|
|
88
|
+
rules_1.RULE_NEVER_ON_SCHEDULE,
|
|
89
|
+
rules_1.RULE_IS_MERGE_REQUEST,
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
: {};
|
|
94
|
+
if (((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto") {
|
|
95
|
+
return {
|
|
96
|
+
[exports.RELEASE_BUTTON_JOB_NAME]: {
|
|
97
|
+
...releaseJobBase,
|
|
98
|
+
rules: [
|
|
99
|
+
...baseReleaseRules,
|
|
100
|
+
{
|
|
101
|
+
if: rules_1.RULE_CONDITION_MAIN_BRANCH,
|
|
102
|
+
when: "on_success",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
|
|
106
|
+
when: "manual",
|
|
107
|
+
// per-rule: only the unclicked hotfix button must not
|
|
108
|
+
// block — a failed automatic release stays loud
|
|
109
|
+
allow_failure: true,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
...forceReleaseJob,
|
|
114
|
+
...checkJob,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const executorNeeds = [
|
|
118
|
+
{ job: exports.RELEASE_BUTTON_JOB_NAME },
|
|
119
|
+
// optional: hotfix pipelines (and rules-filtered jobs) contain a
|
|
120
|
+
// different job subset
|
|
121
|
+
...mainBranchJobNames.map((name) => ({ job: name, optional: true })),
|
|
122
|
+
];
|
|
123
|
+
if (executorNeeds.length > GITLAB_MAX_NEEDS) {
|
|
124
|
+
console.warn(`⚠️ the main-branch pipeline has more than ${GITLAB_MAX_NEEDS} jobs — ` +
|
|
125
|
+
`the "${exports.RELEASE_BUTTON_JOB_NAME}" job falls back to being playable ` +
|
|
126
|
+
`only once the pipeline finished (gitlab caps needs: at ${GITLAB_MAX_NEEDS})`);
|
|
127
|
+
return {
|
|
128
|
+
[exports.RELEASE_BUTTON_JOB_NAME]: {
|
|
129
|
+
...releaseJobBase,
|
|
130
|
+
allow_failure: true,
|
|
131
|
+
rules: manualReleaseRules,
|
|
132
|
+
},
|
|
133
|
+
...forceReleaseJob,
|
|
134
|
+
...checkJob,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
// the queue button: playable from the first second of the pipeline.
|
|
139
|
+
// It only records the intent to release — the executor below does
|
|
140
|
+
// the actual work once every other job succeeded. Clicking after the
|
|
141
|
+
// pipeline finished works the same (the executor starts right away).
|
|
142
|
+
[exports.RELEASE_BUTTON_JOB_NAME]: {
|
|
143
|
+
stage: "release",
|
|
144
|
+
image: releaseImage,
|
|
145
|
+
script: [
|
|
146
|
+
`echo "release queued — '${exports.RELEASE_EXECUTOR_JOB_NAME}' runs it as soon as every other job in this pipeline succeeded"`,
|
|
147
|
+
],
|
|
148
|
+
needs: [],
|
|
149
|
+
// allow_failure keeps the unclicked button from blocking the
|
|
150
|
+
// pipeline AND makes the executor's needs treat it as optional
|
|
151
|
+
// (skipped executor instead of a forever-waiting pipeline)
|
|
152
|
+
allow_failure: true,
|
|
153
|
+
rules: manualReleaseRules,
|
|
154
|
+
},
|
|
155
|
+
// the executor: never played manually. Skipped when the button was
|
|
156
|
+
// not clicked; otherwise starts automatically as soon as the button
|
|
157
|
+
// and every other (non-manual) job of the pipeline succeeded, and
|
|
158
|
+
// is skipped when any of them failed.
|
|
159
|
+
[exports.RELEASE_EXECUTOR_JOB_NAME]: {
|
|
160
|
+
...releaseJobBase,
|
|
161
|
+
needs: executorNeeds,
|
|
52
162
|
rules: [
|
|
53
163
|
...baseReleaseRules,
|
|
54
164
|
{
|
|
55
165
|
if: rules_1.RULE_CONDITION_MAIN_BRANCH,
|
|
56
|
-
when: "
|
|
166
|
+
when: "on_success",
|
|
57
167
|
},
|
|
58
168
|
{
|
|
59
169
|
if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
|
|
60
|
-
when: "
|
|
170
|
+
when: "on_success",
|
|
61
171
|
},
|
|
62
172
|
],
|
|
63
173
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// widget as an exposed artifact
|
|
67
|
-
...(method.checkScript
|
|
68
|
-
? {
|
|
69
|
-
["🦋 changeset check"]: {
|
|
70
|
-
stage: "test",
|
|
71
|
-
image: releaseImage,
|
|
72
|
-
script: [method.checkScript],
|
|
73
|
-
allow_failure: true,
|
|
74
|
-
artifacts: {
|
|
75
|
-
paths: ["changeset-report.md"],
|
|
76
|
-
expose_as: "changeset report",
|
|
77
|
-
// the report must survive the warning exit
|
|
78
|
-
when: "always",
|
|
79
|
-
},
|
|
80
|
-
rules: [
|
|
81
|
-
rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
|
|
82
|
-
rules_1.RULE_NEVER_ON_SCHEDULE,
|
|
83
|
-
rules_1.RULE_IS_MERGE_REQUEST,
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
}
|
|
87
|
-
: {}),
|
|
174
|
+
...forceReleaseJob,
|
|
175
|
+
...checkJob,
|
|
88
176
|
};
|
|
89
177
|
};
|
|
90
178
|
exports.getGitlabReleaseJobs = getGitlabReleaseJobs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlabReleaseJobs.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.ts"],"names":[],"mappings":";;;AAAA,uCAOqB;AAErB,2CAAiD;AAIjD,MAAM,kBAAkB,GACtB,gJAAgJ,CAAC;AAEnJ,MAAM,gBAAgB,GAAG;IACvB,oCAA4B;IAC5B,mCAA2B;IAC3B,8BAAsB;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"gitlabReleaseJobs.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.ts"],"names":[],"mappings":";;;AAAA,uCAOqB;AAErB,2CAAiD;AAIjD,MAAM,kBAAkB,GACtB,gJAAgJ,CAAC;AAEnJ;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEf,QAAA,uBAAuB,GAAG,gBAAgB,CAAC;AAC3C,QAAA,yBAAyB,GAAG,mCAAmC,CAAC;AAE7E,MAAM,gBAAgB,GAAG;IACvB,oCAA4B;IAC5B,mCAA2B;IAC3B,8BAAsB;CACvB,CAAC;AAEF,sEAAsE;AACtE,mEAAmE;AACnE,uEAAuE;AACvE,oCAAoC;AACpC,MAAM,kBAAkB,GAAG;IACzB,GAAG,gBAAgB;IACnB;QACE,EAAE,EAAE,kCAA0B;QAC9B,IAAI,EAAE,QAAQ;KACf;IACD;QACE,EAAE,EAAE,oCAA4B;QACh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AkE;QAClE,qEAAqE;QACrE,qEAAqE;QACrE,CAAC,+BAAuB,CAAC,EAAE;YACzB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE;gBACN,2BAA2B,iCAAyB,kEAAkE;aACvH;YACD,KAAK,EAAE,EAAE;YACT,6DAA6D;YAC7D,+DAA+D;YAC/D,2DAA2D;YAC3D,aAAa,EAAE,IAAI;YACnB,KAAK,EAAE,kBAAkB;SACH;QACxB,mEAAmE;QACnE,oEAAoE;QACpE,kEAAkE;QAClE,sCAAsC;QACtC,CAAC,iCAAyB,CAAC,EAAE;YAC3B,GAAG,cAAc;YACjB,KAAK,EAAE,aAAa;YACpB,KAAK,EAAE;gBACL,GAAG,gBAAgB;gBACnB;oBACE,EAAE,EAAE,kCAA0B;oBAC9B,IAAI,EAAE,YAAY;iBACnB;gBACD;oBACE,EAAE,EAAE,oCAA4B;oBAChC,IAAI,EAAE,YAAY;iBACnB;aACqB;SACF;QACxB,GAAG,eAAe;QAClB,GAAG,QAAQ;KACZ,CAAC;AACJ,CAAC,CAAC;AAzJW,QAAA,oBAAoB,wBAyJ/B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Artifacts, EnvVars
|
|
1
|
+
import type { Artifacts, EnvVars } from "../types";
|
|
2
|
+
import type { JobImageConfig } from "../customImages/projectImages";
|
|
2
3
|
import type { Services } from "../types/gitlab-ci-yml";
|
|
3
4
|
import type { CatladderJob, CatladderJobCache } from "../types/jobs";
|
|
4
5
|
export type CacheConfigAdvanced = Omit<CatladderJobCache, "paths" | "key"> & {
|
|
@@ -80,7 +81,7 @@ export type WithCacheConfig = {
|
|
|
80
81
|
};
|
|
81
82
|
export type TestJobCustom = {
|
|
82
83
|
command?: string | string[];
|
|
83
|
-
jobImage?:
|
|
84
|
+
jobImage?: JobImageConfig;
|
|
84
85
|
/**
|
|
85
86
|
* additional CI/CD artifacts reports,
|
|
86
87
|
* use to display information in merge requests, pipeline views and security dashboards.
|
|
@@ -162,7 +163,7 @@ export type BuildConfigBase = {
|
|
|
162
163
|
/**
|
|
163
164
|
* custom image to use
|
|
164
165
|
*/
|
|
165
|
-
jobImage?:
|
|
166
|
+
jobImage?: JobImageConfig;
|
|
166
167
|
} & WithCacheConfig;
|
|
167
168
|
export type BuildConfigNodeBase = BuildConfigBase & {
|
|
168
169
|
/**
|
|
@@ -248,7 +249,7 @@ type BuildConfigDockerCustom = {
|
|
|
248
249
|
export type BuildConfigDocker = BuildConfigDockerBuiltIn | BuildConfigDockerCustom;
|
|
249
250
|
export type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" | "audit"> & {
|
|
250
251
|
type: "custom";
|
|
251
|
-
jobImage:
|
|
252
|
+
jobImage: JobImageConfig;
|
|
252
253
|
/**
|
|
253
254
|
* {@link Services}s used in lint, test, audit, and build jobs.
|
|
254
255
|
*/
|
|
@@ -377,7 +378,7 @@ export type WorkspaceBuildConfigBase = {
|
|
|
377
378
|
* use to display information in merge requests, pipeline views and security dashboards.
|
|
378
379
|
*/
|
|
379
380
|
artifactsReports?: BuildConfigArtifactsReports;
|
|
380
|
-
jobImage?:
|
|
381
|
+
jobImage?: JobImageConfig;
|
|
381
382
|
/**
|
|
382
383
|
* tags for the underlying job runner (e.g gitlab)
|
|
383
384
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/build/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/build/types.ts"],"names":[],"mappings":";;;AA+ZO,MAAM,uBAAuB,GAAG,CACrC,CAAsB,EACM,EAAE;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;AACxB,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC;AAEK,MAAM,aAAa,GAAG,CAC3B,CAAc,EACd,GAAG,KAAQ,EACqC,EAAE;IAClD,IAAI,CAAC,IAAA,+BAAuB,EAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}
|
|
@@ -13,3 +13,12 @@ export type CustomImageHashResult = {
|
|
|
13
13
|
watchedPaths: string[];
|
|
14
14
|
};
|
|
15
15
|
export declare function computeCustomImageHash(config: ImageHashConfig): CustomImageHashResult;
|
|
16
|
+
/**
|
|
17
|
+
* the hash of an image defined by an inline Dockerfile: its content
|
|
18
|
+
* stands in for the definition dir. The build context is deliberately
|
|
19
|
+
* NOT hashed (it may be the whole repository) — `hashExtraPaths` is how
|
|
20
|
+
* context files opt into the hash.
|
|
21
|
+
*/
|
|
22
|
+
export declare function computeInlineImageHash(config: Pick<ImageHashConfig, "hashExtraPaths" | "buildArgs"> & {
|
|
23
|
+
dockerfileContent: string;
|
|
24
|
+
}): CustomImageHashResult;
|