@catladder/cli 0.0.0-next-dccc0a36 → 0.0.0-next-89bce6d0
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 +340 -109
- package/dist/bundles/cli/index.js +340 -109
- package/dist/bundles/skills/catladder-deploys/references/deploy-types.md +1 -1
- package/dist/bundles/skills/catladder-releases/SKILL.md +13 -2
- package/dist/packages/bash/src/variables/VariableValueContainingReferences.d.ts +6 -0
- package/dist/packages/bash/src/variables/VariableValueContainingReferences.js +8 -0
- package/dist/packages/bash/src/variables/VariableValueContainingReferences.js.map +1 -1
- package/dist/packages/bash/src/variables/resolveAllReferences.d.ts +1 -2
- package/dist/packages/bash/src/variables/resolveAllReferences.js +4 -2
- package/dist/packages/bash/src/variables/resolveAllReferences.js.map +1 -1
- package/dist/packages/bash/src/variables/resolveAllReferencesOnce.d.ts +1 -4
- package/dist/packages/bash/src/variables/resolveAllReferencesOnce.js +4 -2
- package/dist/packages/bash/src/variables/resolveAllReferencesOnce.js.map +1 -1
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js +7 -0
- 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 +31 -5
- 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/context/getEnvironmentVariables.js +17 -9
- package/dist/packages/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/cloudRun/index.js +2 -2
- package/dist/packages/pipeline/src/deploy/cloudRun/index.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/cloudRun/utils/database.d.ts +7 -9
- package/dist/packages/pipeline/src/deploy/cloudRun/utils/database.js +32 -24
- package/dist/packages/pipeline/src/deploy/cloudRun/utils/database.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/index.d.ts +2 -2
- package/dist/packages/pipeline/src/types/github-types.d.ts +1 -0
- package/dist/packages/pipeline/src/types/release.d.ts +7 -1
- package/dist/skills/catladder-deploys/references/deploy-types.md +1 -1
- 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;QAChC,IAAI,EAAE,QAAQ;KACf;CACqB,CAAC;AAElB,MAAM,oBAAoB,GAAG,CAClC,MAAc,EACd,MAAqB;AACrB;;;;GAIG;AACH,kBAA4B,EAC5B,EAAE;;IACF,MAAM,MAAM,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC,CAAC;I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T,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"}
|
|
@@ -46,7 +46,9 @@ const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
|
46
46
|
const additionalEnvVars = deployConfigRaw
|
|
47
47
|
? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext)
|
|
48
48
|
: {};
|
|
49
|
-
|
|
49
|
+
// deploy types provide HOSTNAME_INTERNAL as a plain string or bash
|
|
50
|
+
// expression (never containing references)
|
|
51
|
+
const HOSTNAME_INTERNAL = ((_b = additionalEnvVars.HOSTNAME_INTERNAL) !== null && _b !== void 0 ? _b : "unknown-host.example.com");
|
|
50
52
|
host = (_c = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _c !== void 0 ? _c : HOSTNAME_INTERNAL;
|
|
51
53
|
url = (0, bash_1.joinBashExpressions)(["https://", host]);
|
|
52
54
|
predefinedVariables = {
|
|
@@ -74,8 +76,18 @@ const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
|
74
76
|
componentName: ctx.componentName,
|
|
75
77
|
}),
|
|
76
78
|
]));
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
// predefined variables may contain references too (e.g. the embedded
|
|
80
|
+
// database connection string references the component's own DB_* vars), so
|
|
81
|
+
// we resolve references over the merged map. This way public var overrides
|
|
82
|
+
// (like DB_PASSWORD: "${otherComponent:DB_PASSWORD}") are picked up by the
|
|
83
|
+
// predefined variables that reference them
|
|
84
|
+
const mergedEnvVars = {
|
|
85
|
+
...predefinedVariables,
|
|
86
|
+
...secretEnvVars,
|
|
87
|
+
...publicEnvVarsUnresolved,
|
|
88
|
+
};
|
|
89
|
+
const resolvedEnvVars = ((_g = options.shouldResolveReferences) !== null && _g !== void 0 ? _g : true)
|
|
90
|
+
? await (0, bash_3.resolveAllReferences)(mergedEnvVars, async (otherComponentName) => {
|
|
79
91
|
const { envVars: otherEnvVars } = await (0, exports.getEnvironmentVariables)({
|
|
80
92
|
...ctx,
|
|
81
93
|
componentName: otherComponentName,
|
|
@@ -84,12 +96,8 @@ const getEnvironmentVariables = async (ctx, options = {}) => {
|
|
|
84
96
|
});
|
|
85
97
|
return otherEnvVars;
|
|
86
98
|
})
|
|
87
|
-
:
|
|
88
|
-
const envVars = addIndexVar(
|
|
89
|
-
...predefinedVariables,
|
|
90
|
-
...secretEnvVars,
|
|
91
|
-
...publicEnvVars,
|
|
92
|
-
});
|
|
99
|
+
: mergedEnvVars;
|
|
100
|
+
const envVars = addIndexVar(resolvedEnvVars);
|
|
93
101
|
return {
|
|
94
102
|
envVars,
|
|
95
103
|
secretEnvVarKeys,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEnvironmentVariables.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvironmentVariables.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AASzC,0CAAsD;AACtD,0CAAyD;AAEzD,0CAAoF;AACpF,0CAAuD;AACvD,mEAAgE;AAChE,mEAAgE;AAChE,iEAA8D;AAC9D,6CAIyB;AAgBzB,MAAM,0BAA0B,GAAG,CAAC,GAAuB,EAAE,EAAE;IAC7D,OAAO;QACL,SAAS,EAAE,GAAG,C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CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5C,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,SAAS,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,iBAAiB,GAAG,eAAe;YACvC,CAAC,CAAC,qBAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,oBAAoB,CACrD,kBAA2B,CAC5B;YACH,CAAC,CAAC,EAAE,CAAC;QAEP,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"getEnvironmentVariables.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/getEnvironmentVariables.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AASzC,0CAAsD;AACtD,0CAAyD;AAEzD,0CAAoF;AACpF,0CAAuD;AACvD,mEAAgE;AAChE,mEAAgE;AAChE,iEAA8D;AAC9D,6CAIyB;AAgBzB,MAAM,0BAA0B,GAAG,CAAC,GAAuB,EAAE,EAAE;IAC7D,OAAO;QACL,SAAS,EAAE,GAAG,CAAC,GAAG;QAClB,OAAO,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG;QAC7B,QAAQ,EAAE,GAAG,CAAC,OAAO;QACrB,GAAG,CAAC,GAAG,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,I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environmentSlugPrefix, env, com
|
|
|
26
26
|
};
|
|
27
27
|
return {
|
|
28
28
|
...dbVars,
|
|
29
|
-
DATABASE_URL: (0, database_1.getDatabaseConnectionString)(deployConfigRaw.cloudSql, dbVars).concat(additionalQueryParamsString),
|
|
30
|
-
DATABASE_JDBC_URL: (0, database_1.getDatabaseJdbcUrl)(dbVars, (_c = deployConfigRaw.cloudSql.dbConnectionStringVariablesMode) !== null && _c !== void 0 ? _c : database_1.DEFAULT_DB_VARIABLES_MODE),
|
|
29
|
+
DATABASE_URL: (0, database_1.getDatabaseConnectionString)(deployConfigRaw.cloudSql, dbVars, componentName).concat(additionalQueryParamsString),
|
|
30
|
+
DATABASE_JDBC_URL: (0, database_1.getDatabaseJdbcUrl)(dbVars, (_c = deployConfigRaw.cloudSql.dbConnectionStringVariablesMode) !== null && _c !== void 0 ? _c : database_1.DEFAULT_DB_VARIABLES_MODE, componentName),
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
return {};
|