@backstage/plugin-scaffolder-backend 1.19.0-next.1 → 1.19.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/CHANGELOG.md +64 -0
- package/alpha/package.json +1 -1
- package/config.d.ts +18 -0
- package/dist/alpha.cjs.js +2 -1
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/cjs/{router-b3ae7270.cjs.js → router-6b5fa0be.cjs.js} +249 -99
- package/dist/cjs/router-6b5fa0be.cjs.js.map +1 -0
- package/dist/index.cjs.js +2 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/package.json +19 -18
- package/dist/cjs/router-b3ae7270.cjs.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var catalogModel = require('@backstage/catalog-model');
|
|
4
|
+
var config = require('@backstage/config');
|
|
4
5
|
var errors = require('@backstage/errors');
|
|
5
6
|
var integration = require('@backstage/integration');
|
|
6
7
|
var pluginScaffolderCommon = require('@backstage/plugin-scaffolder-common');
|
|
@@ -80,7 +81,7 @@ var winston__namespace = /*#__PURE__*/_interopNamespace(winston);
|
|
|
80
81
|
var nunjucks__default = /*#__PURE__*/_interopDefaultLegacy(nunjucks);
|
|
81
82
|
var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
|
|
82
83
|
|
|
83
|
-
const examples$
|
|
84
|
+
const examples$m = [
|
|
84
85
|
{
|
|
85
86
|
description: "Register with the catalog",
|
|
86
87
|
example: yaml__default["default"].stringify({
|
|
@@ -104,7 +105,7 @@ function createCatalogRegisterAction(options) {
|
|
|
104
105
|
return pluginScaffolderNode.createTemplateAction({
|
|
105
106
|
id: id$4,
|
|
106
107
|
description: "Registers entities from a catalog descriptor file in the workspace into the software catalog.",
|
|
107
|
-
examples: examples$
|
|
108
|
+
examples: examples$m,
|
|
108
109
|
schema: {
|
|
109
110
|
input: {
|
|
110
111
|
oneOf: [
|
|
@@ -228,7 +229,7 @@ function createCatalogRegisterAction(options) {
|
|
|
228
229
|
});
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
const examples$
|
|
232
|
+
const examples$l = [
|
|
232
233
|
{
|
|
233
234
|
description: "Write a catalog yaml file",
|
|
234
235
|
example: yaml__namespace.stringify({
|
|
@@ -272,7 +273,7 @@ function createCatalogWriteAction() {
|
|
|
272
273
|
)
|
|
273
274
|
})
|
|
274
275
|
},
|
|
275
|
-
examples: examples$
|
|
276
|
+
examples: examples$l,
|
|
276
277
|
supportsDryRun: true,
|
|
277
278
|
async handler(ctx) {
|
|
278
279
|
ctx.logStream.write(`Writing catalog-info.yaml`);
|
|
@@ -286,7 +287,7 @@ function createCatalogWriteAction() {
|
|
|
286
287
|
});
|
|
287
288
|
}
|
|
288
289
|
|
|
289
|
-
const examples$
|
|
290
|
+
const examples$k = [
|
|
290
291
|
{
|
|
291
292
|
description: "Fetch entity by reference",
|
|
292
293
|
example: yaml__default["default"].stringify({
|
|
@@ -325,7 +326,7 @@ function createFetchCatalogEntityAction(options) {
|
|
|
325
326
|
return pluginScaffolderNode.createTemplateAction({
|
|
326
327
|
id: id$2,
|
|
327
328
|
description: "Returns entity or entities from the catalog by entity reference(s)",
|
|
328
|
-
examples: examples$
|
|
329
|
+
examples: examples$k,
|
|
329
330
|
supportsDryRun: true,
|
|
330
331
|
schema: {
|
|
331
332
|
input: zod.z.object({
|
|
@@ -400,7 +401,7 @@ function createFetchCatalogEntityAction(options) {
|
|
|
400
401
|
});
|
|
401
402
|
}
|
|
402
403
|
|
|
403
|
-
const examples$
|
|
404
|
+
const examples$j = [
|
|
404
405
|
{
|
|
405
406
|
description: "Write a debug message",
|
|
406
407
|
example: yaml__default["default"].stringify({
|
|
@@ -438,7 +439,7 @@ function createDebugLogAction() {
|
|
|
438
439
|
return pluginScaffolderNode.createTemplateAction({
|
|
439
440
|
id: id$1,
|
|
440
441
|
description: "Writes a message into the log or lists all files in the workspace.",
|
|
441
|
-
examples: examples$
|
|
442
|
+
examples: examples$j,
|
|
442
443
|
schema: {
|
|
443
444
|
input: {
|
|
444
445
|
type: "object",
|
|
@@ -485,7 +486,7 @@ async function recursiveReadDir(dir) {
|
|
|
485
486
|
return files.reduce((a, f) => a.concat(f), []);
|
|
486
487
|
}
|
|
487
488
|
|
|
488
|
-
const examples$
|
|
489
|
+
const examples$i = [
|
|
489
490
|
{
|
|
490
491
|
description: "Waiting for 50 milliseconds",
|
|
491
492
|
example: yaml__default["default"].stringify({
|
|
@@ -548,7 +549,7 @@ function createWaitAction(options) {
|
|
|
548
549
|
return pluginScaffolderNode.createTemplateAction({
|
|
549
550
|
id,
|
|
550
551
|
description: "Waits for a certain period of time.",
|
|
551
|
-
examples: examples$
|
|
552
|
+
examples: examples$i,
|
|
552
553
|
schema: {
|
|
553
554
|
input: {
|
|
554
555
|
type: "object",
|
|
@@ -593,7 +594,7 @@ function createWaitAction(options) {
|
|
|
593
594
|
});
|
|
594
595
|
}
|
|
595
596
|
|
|
596
|
-
const examples$
|
|
597
|
+
const examples$h = [
|
|
597
598
|
{
|
|
598
599
|
description: "Downloads content and places it in the workspace.",
|
|
599
600
|
example: yaml__default["default"].stringify({
|
|
@@ -632,7 +633,7 @@ function createFetchPlainAction(options) {
|
|
|
632
633
|
const { reader, integrations } = options;
|
|
633
634
|
return pluginScaffolderNode.createTemplateAction({
|
|
634
635
|
id: ACTION_ID,
|
|
635
|
-
examples: examples$
|
|
636
|
+
examples: examples$h,
|
|
636
637
|
description: "Downloads content and places it in the workspace, or optionally in a subdirectory specified by the `targetPath` input option.",
|
|
637
638
|
schema: {
|
|
638
639
|
input: {
|
|
@@ -669,7 +670,7 @@ function createFetchPlainAction(options) {
|
|
|
669
670
|
});
|
|
670
671
|
}
|
|
671
672
|
|
|
672
|
-
const examples$
|
|
673
|
+
const examples$g = [
|
|
673
674
|
{
|
|
674
675
|
description: "Downloads a file and places it in the workspace.",
|
|
675
676
|
example: yaml__default["default"].stringify({
|
|
@@ -693,7 +694,7 @@ function createFetchPlainFileAction(options) {
|
|
|
693
694
|
return pluginScaffolderNode.createTemplateAction({
|
|
694
695
|
id: "fetch:plain:file",
|
|
695
696
|
description: "Downloads single file and places it in the workspace.",
|
|
696
|
-
examples: examples$
|
|
697
|
+
examples: examples$g,
|
|
697
698
|
schema: {
|
|
698
699
|
input: {
|
|
699
700
|
type: "object",
|
|
@@ -961,7 +962,7 @@ const createDefaultFilters = ({
|
|
|
961
962
|
};
|
|
962
963
|
};
|
|
963
964
|
|
|
964
|
-
const examples$
|
|
965
|
+
const examples$f = [
|
|
965
966
|
{
|
|
966
967
|
description: "Downloads a skelaton directory that lives alongside the template file and fill it out with values.",
|
|
967
968
|
example: yaml__default["default"].stringify({
|
|
@@ -997,7 +998,7 @@ function createFetchTemplateAction(options) {
|
|
|
997
998
|
return pluginScaffolderNode.createTemplateAction({
|
|
998
999
|
id: "fetch:template",
|
|
999
1000
|
description: "Downloads a skeleton, templates variables into file and directory names and content, and places the result in the workspace, or optionally in a subdirectory specified by the `targetPath` input option.",
|
|
1000
|
-
examples: examples$
|
|
1001
|
+
examples: examples$f,
|
|
1001
1002
|
schema: {
|
|
1002
1003
|
input: {
|
|
1003
1004
|
type: "object",
|
|
@@ -1110,17 +1111,13 @@ function createFetchTemplateAction(options) {
|
|
|
1110
1111
|
followSymbolicLinks: false
|
|
1111
1112
|
});
|
|
1112
1113
|
const nonTemplatedEntries = new Set(
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
followSymbolicLinks: false
|
|
1121
|
-
})
|
|
1122
|
-
)
|
|
1123
|
-
)).flat()
|
|
1114
|
+
await globby__default["default"](copyOnlyPatterns || [], {
|
|
1115
|
+
cwd: templateDir,
|
|
1116
|
+
dot: true,
|
|
1117
|
+
onlyFiles: false,
|
|
1118
|
+
markDirectories: true,
|
|
1119
|
+
followSymbolicLinks: false
|
|
1120
|
+
})
|
|
1124
1121
|
);
|
|
1125
1122
|
const { cookiecutterCompat, values } = ctx.input;
|
|
1126
1123
|
const context = {
|
|
@@ -1202,7 +1199,7 @@ function containsSkippedContent(localOutputPath) {
|
|
|
1202
1199
|
return localOutputPath === "" || localOutputPath.startsWith("/") || localOutputPath.includes("//");
|
|
1203
1200
|
}
|
|
1204
1201
|
|
|
1205
|
-
const examples$
|
|
1202
|
+
const examples$e = [
|
|
1206
1203
|
{
|
|
1207
1204
|
description: "Delete specified files",
|
|
1208
1205
|
example: yaml__namespace.stringify({
|
|
@@ -1224,7 +1221,7 @@ const createFilesystemDeleteAction = () => {
|
|
|
1224
1221
|
return pluginScaffolderNode.createTemplateAction({
|
|
1225
1222
|
id: "fs:delete",
|
|
1226
1223
|
description: "Deletes files and directories from the workspace",
|
|
1227
|
-
examples: examples$
|
|
1224
|
+
examples: examples$e,
|
|
1228
1225
|
schema: {
|
|
1229
1226
|
input: {
|
|
1230
1227
|
required: ["files"],
|
|
@@ -1261,7 +1258,7 @@ const createFilesystemDeleteAction = () => {
|
|
|
1261
1258
|
});
|
|
1262
1259
|
};
|
|
1263
1260
|
|
|
1264
|
-
const examples$
|
|
1261
|
+
const examples$d = [
|
|
1265
1262
|
{
|
|
1266
1263
|
description: "Rename specified files ",
|
|
1267
1264
|
example: yaml__namespace.stringify({
|
|
@@ -1287,7 +1284,7 @@ const createFilesystemRenameAction = () => {
|
|
|
1287
1284
|
return pluginScaffolderNode.createTemplateAction({
|
|
1288
1285
|
id: "fs:rename",
|
|
1289
1286
|
description: "Renames files and directories within the workspace",
|
|
1290
|
-
examples: examples$
|
|
1287
|
+
examples: examples$d,
|
|
1291
1288
|
schema: {
|
|
1292
1289
|
input: {
|
|
1293
1290
|
required: ["files"],
|
|
@@ -1769,7 +1766,7 @@ async function validateAccessTeam(client, access) {
|
|
|
1769
1766
|
}
|
|
1770
1767
|
}
|
|
1771
1768
|
|
|
1772
|
-
const examples$
|
|
1769
|
+
const examples$c = [
|
|
1773
1770
|
{
|
|
1774
1771
|
description: "GitHub Action Workflow Without Inputs.",
|
|
1775
1772
|
example: yaml__default["default"].stringify({
|
|
@@ -1830,7 +1827,7 @@ function createGithubActionsDispatchAction(options) {
|
|
|
1830
1827
|
return pluginScaffolderNode.createTemplateAction({
|
|
1831
1828
|
id: "github:actions:dispatch",
|
|
1832
1829
|
description: "Dispatches a GitHub Action workflow for a given branch or tag",
|
|
1833
|
-
examples: examples$
|
|
1830
|
+
examples: examples$c,
|
|
1834
1831
|
schema: {
|
|
1835
1832
|
input: {
|
|
1836
1833
|
type: "object",
|
|
@@ -1899,7 +1896,7 @@ function createGithubActionsDispatchAction(options) {
|
|
|
1899
1896
|
});
|
|
1900
1897
|
}
|
|
1901
1898
|
|
|
1902
|
-
const examples$
|
|
1899
|
+
const examples$b = [
|
|
1903
1900
|
{
|
|
1904
1901
|
description: "Add labels to pull request or issue",
|
|
1905
1902
|
example: yaml__default["default"].stringify({
|
|
@@ -1940,7 +1937,7 @@ function createGithubIssuesLabelAction(options) {
|
|
|
1940
1937
|
return pluginScaffolderNode.createTemplateAction({
|
|
1941
1938
|
id: "github:issues:label",
|
|
1942
1939
|
description: "Adds labels to a pull request or issue on GitHub.",
|
|
1943
|
-
examples: examples$
|
|
1940
|
+
examples: examples$b,
|
|
1944
1941
|
schema: {
|
|
1945
1942
|
input: {
|
|
1946
1943
|
type: "object",
|
|
@@ -2263,7 +2260,7 @@ const commitHash = {
|
|
|
2263
2260
|
type: "string"
|
|
2264
2261
|
};
|
|
2265
2262
|
|
|
2266
|
-
const examples$
|
|
2263
|
+
const examples$a = [
|
|
2267
2264
|
{
|
|
2268
2265
|
description: "Creates a GitHub repository with default configuration.",
|
|
2269
2266
|
example: yaml__default["default"].stringify({
|
|
@@ -2316,7 +2313,7 @@ function createGithubRepoCreateAction(options) {
|
|
|
2316
2313
|
return pluginScaffolderNode.createTemplateAction({
|
|
2317
2314
|
id: "github:repo:create",
|
|
2318
2315
|
description: "Creates a GitHub repository.",
|
|
2319
|
-
examples: examples$
|
|
2316
|
+
examples: examples$a,
|
|
2320
2317
|
schema: {
|
|
2321
2318
|
input: {
|
|
2322
2319
|
type: "object",
|
|
@@ -2423,7 +2420,7 @@ function createGithubRepoCreateAction(options) {
|
|
|
2423
2420
|
});
|
|
2424
2421
|
}
|
|
2425
2422
|
|
|
2426
|
-
const examples$
|
|
2423
|
+
const examples$9 = [
|
|
2427
2424
|
{
|
|
2428
2425
|
description: "Setup repo with no modifications to branch protection rules",
|
|
2429
2426
|
example: yaml__default["default"].stringify({
|
|
@@ -2475,7 +2472,7 @@ function createGithubRepoPushAction(options) {
|
|
|
2475
2472
|
return pluginScaffolderNode.createTemplateAction({
|
|
2476
2473
|
id: "github:repo:push",
|
|
2477
2474
|
description: "Initializes a git repository of contents in workspace and publishes it to GitHub.",
|
|
2478
|
-
examples: examples$
|
|
2475
|
+
examples: examples$9,
|
|
2479
2476
|
schema: {
|
|
2480
2477
|
input: {
|
|
2481
2478
|
type: "object",
|
|
@@ -2577,7 +2574,7 @@ function createGithubRepoPushAction(options) {
|
|
|
2577
2574
|
});
|
|
2578
2575
|
}
|
|
2579
2576
|
|
|
2580
|
-
const examples$
|
|
2577
|
+
const examples$8 = [
|
|
2581
2578
|
{
|
|
2582
2579
|
description: "Create a GitHub webhook for a repository",
|
|
2583
2580
|
example: yaml__default["default"].stringify({
|
|
@@ -2686,7 +2683,7 @@ function createGithubWebhookAction(options) {
|
|
|
2686
2683
|
return pluginScaffolderNode.createTemplateAction({
|
|
2687
2684
|
id: "github:webhook",
|
|
2688
2685
|
description: "Creates webhook for a repository on GitHub.",
|
|
2689
|
-
examples: examples$
|
|
2686
|
+
examples: examples$8,
|
|
2690
2687
|
schema: {
|
|
2691
2688
|
input: {
|
|
2692
2689
|
type: "object",
|
|
@@ -2799,7 +2796,7 @@ function createGithubWebhookAction(options) {
|
|
|
2799
2796
|
});
|
|
2800
2797
|
}
|
|
2801
2798
|
|
|
2802
|
-
const examples$
|
|
2799
|
+
const examples$7 = [
|
|
2803
2800
|
{
|
|
2804
2801
|
description: "Example 1: Create and store a Deploy Key",
|
|
2805
2802
|
example: yaml__default["default"].stringify({
|
|
@@ -2824,7 +2821,7 @@ function createGithubDeployKeyAction(options) {
|
|
|
2824
2821
|
return pluginScaffolderNode.createTemplateAction({
|
|
2825
2822
|
id: "github:deployKey:create",
|
|
2826
2823
|
description: "Creates and stores Deploy Keys",
|
|
2827
|
-
examples: examples$
|
|
2824
|
+
examples: examples$7,
|
|
2828
2825
|
schema: {
|
|
2829
2826
|
input: {
|
|
2830
2827
|
type: "object",
|
|
@@ -2927,7 +2924,7 @@ function createGithubDeployKeyAction(options) {
|
|
|
2927
2924
|
});
|
|
2928
2925
|
}
|
|
2929
2926
|
|
|
2930
|
-
const examples$
|
|
2927
|
+
const examples$6 = [
|
|
2931
2928
|
{
|
|
2932
2929
|
description: "Create a GitHub Environment (No Policies, No Variables, No Secrets)",
|
|
2933
2930
|
example: yaml__default["default"].stringify({
|
|
@@ -3012,7 +3009,7 @@ function createGithubEnvironmentAction(options) {
|
|
|
3012
3009
|
return pluginScaffolderNode.createTemplateAction({
|
|
3013
3010
|
id: "github:environment:create",
|
|
3014
3011
|
description: "Creates Deployment Environments",
|
|
3015
|
-
examples: examples$
|
|
3012
|
+
examples: examples$6,
|
|
3016
3013
|
schema: {
|
|
3017
3014
|
input: {
|
|
3018
3015
|
type: "object",
|
|
@@ -3155,7 +3152,7 @@ function createGithubEnvironmentAction(options) {
|
|
|
3155
3152
|
});
|
|
3156
3153
|
}
|
|
3157
3154
|
|
|
3158
|
-
const examples$
|
|
3155
|
+
const examples$5 = [
|
|
3159
3156
|
{
|
|
3160
3157
|
description: "Initializes a git repository of the content in the workspace, and publishes it to Azure.",
|
|
3161
3158
|
example: yaml__default["default"].stringify({
|
|
@@ -3210,7 +3207,7 @@ function createPublishAzureAction(options) {
|
|
|
3210
3207
|
const { integrations, config } = options;
|
|
3211
3208
|
return pluginScaffolderNode.createTemplateAction({
|
|
3212
3209
|
id: "publish:azure",
|
|
3213
|
-
examples: examples$
|
|
3210
|
+
examples: examples$5,
|
|
3214
3211
|
description: "Initializes a git repository of the content in the workspace, and publishes it to Azure.",
|
|
3215
3212
|
schema: {
|
|
3216
3213
|
input: {
|
|
@@ -3352,7 +3349,7 @@ function createPublishAzureAction(options) {
|
|
|
3352
3349
|
});
|
|
3353
3350
|
}
|
|
3354
3351
|
|
|
3355
|
-
const examples$
|
|
3352
|
+
const examples$4 = [
|
|
3356
3353
|
{
|
|
3357
3354
|
description: "Initializes a git repository of contents in workspace and publish it to Bitbucket with default configuration.",
|
|
3358
3355
|
example: yaml__default["default"].stringify({
|
|
@@ -3648,7 +3645,7 @@ function createPublishBitbucketAction(options) {
|
|
|
3648
3645
|
return pluginScaffolderNode.createTemplateAction({
|
|
3649
3646
|
id: "publish:bitbucket",
|
|
3650
3647
|
description: "Initializes a git repository of the content in the workspace, and publishes it to Bitbucket.",
|
|
3651
|
-
examples: examples$
|
|
3648
|
+
examples: examples$4,
|
|
3652
3649
|
schema: {
|
|
3653
3650
|
input: {
|
|
3654
3651
|
type: "object",
|
|
@@ -4425,6 +4422,141 @@ function createPublishBitbucketServerPullRequestAction(options) {
|
|
|
4425
4422
|
});
|
|
4426
4423
|
}
|
|
4427
4424
|
|
|
4425
|
+
const examples$3 = [
|
|
4426
|
+
{
|
|
4427
|
+
description: "Initializes a Gerrit repository of contents in workspace and publish it to Gerrit with default configuration.",
|
|
4428
|
+
example: yaml__default["default"].stringify({
|
|
4429
|
+
steps: [
|
|
4430
|
+
{
|
|
4431
|
+
id: "publish",
|
|
4432
|
+
action: "publish:gerrit",
|
|
4433
|
+
name: "Publish to Gerrit",
|
|
4434
|
+
input: {
|
|
4435
|
+
repoUrl: "gerrit.com?repo=repo&owner=owner"
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4438
|
+
]
|
|
4439
|
+
})
|
|
4440
|
+
},
|
|
4441
|
+
{
|
|
4442
|
+
description: "Initializes a Gerrit repository with a description.",
|
|
4443
|
+
example: yaml__default["default"].stringify({
|
|
4444
|
+
steps: [
|
|
4445
|
+
{
|
|
4446
|
+
id: "publish",
|
|
4447
|
+
action: "publish:gerrit",
|
|
4448
|
+
name: "Publish to Gerrit",
|
|
4449
|
+
input: {
|
|
4450
|
+
repoUrl: "gerrit.com?repo=repo&owner=owner",
|
|
4451
|
+
description: "Initialize a gerrit repository"
|
|
4452
|
+
}
|
|
4453
|
+
}
|
|
4454
|
+
]
|
|
4455
|
+
})
|
|
4456
|
+
},
|
|
4457
|
+
{
|
|
4458
|
+
description: "Initializes a Gerrit repository with a default Branch, if not set defaults to master",
|
|
4459
|
+
example: yaml__default["default"].stringify({
|
|
4460
|
+
steps: [
|
|
4461
|
+
{
|
|
4462
|
+
id: "publish",
|
|
4463
|
+
action: "publish:gerrit",
|
|
4464
|
+
name: "Publish to Gerrit",
|
|
4465
|
+
input: {
|
|
4466
|
+
repoUrl: "gerrit.com?repo=repo&owner=owner",
|
|
4467
|
+
defaultBranch: "staging"
|
|
4468
|
+
}
|
|
4469
|
+
}
|
|
4470
|
+
]
|
|
4471
|
+
})
|
|
4472
|
+
},
|
|
4473
|
+
{
|
|
4474
|
+
description: "Initializes a Gerrit repository with an initial commit message, if not set defaults to initial commit",
|
|
4475
|
+
example: yaml__default["default"].stringify({
|
|
4476
|
+
steps: [
|
|
4477
|
+
{
|
|
4478
|
+
id: "publish",
|
|
4479
|
+
action: "publish:gerrit",
|
|
4480
|
+
name: "Publish to Gerrit",
|
|
4481
|
+
input: {
|
|
4482
|
+
repoUrl: "gerrit.com?repo=repo&owner=owner",
|
|
4483
|
+
gitCommitMessage: "Initial Commit Message"
|
|
4484
|
+
}
|
|
4485
|
+
}
|
|
4486
|
+
]
|
|
4487
|
+
})
|
|
4488
|
+
},
|
|
4489
|
+
{
|
|
4490
|
+
description: "Initializes a Gerrit repository with a repo Author Name, if not set defaults to Scaffolder",
|
|
4491
|
+
example: yaml__default["default"].stringify({
|
|
4492
|
+
steps: [
|
|
4493
|
+
{
|
|
4494
|
+
id: "publish",
|
|
4495
|
+
action: "publish:gerrit",
|
|
4496
|
+
name: "Publish to Gerrit",
|
|
4497
|
+
input: {
|
|
4498
|
+
repoUrl: "gerrit.com?repo=repo&owner=owner",
|
|
4499
|
+
gitAuthorName: "John Doe"
|
|
4500
|
+
}
|
|
4501
|
+
}
|
|
4502
|
+
]
|
|
4503
|
+
})
|
|
4504
|
+
},
|
|
4505
|
+
{
|
|
4506
|
+
description: "Initializes a Gerrit repository with a repo Author Email",
|
|
4507
|
+
example: yaml__default["default"].stringify({
|
|
4508
|
+
steps: [
|
|
4509
|
+
{
|
|
4510
|
+
id: "publish",
|
|
4511
|
+
action: "publish:gerrit",
|
|
4512
|
+
name: "Publish to Gerrit",
|
|
4513
|
+
input: {
|
|
4514
|
+
repoUrl: "gerrit.com?repo=repo&owner=owner",
|
|
4515
|
+
gitAuthorEmail: "johndoe@email.com"
|
|
4516
|
+
}
|
|
4517
|
+
}
|
|
4518
|
+
]
|
|
4519
|
+
})
|
|
4520
|
+
},
|
|
4521
|
+
{
|
|
4522
|
+
description: "Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository",
|
|
4523
|
+
example: yaml__default["default"].stringify({
|
|
4524
|
+
steps: [
|
|
4525
|
+
{
|
|
4526
|
+
id: "publish",
|
|
4527
|
+
action: "publish:gerrit",
|
|
4528
|
+
name: "Publish to Gerrit",
|
|
4529
|
+
input: {
|
|
4530
|
+
repoUrl: "gerrit.com?repo=repo&owner=owner",
|
|
4531
|
+
sourcePath: "repository/"
|
|
4532
|
+
}
|
|
4533
|
+
}
|
|
4534
|
+
]
|
|
4535
|
+
})
|
|
4536
|
+
},
|
|
4537
|
+
{
|
|
4538
|
+
description: "Initializes a Gerrit repository with all proporties being set",
|
|
4539
|
+
example: yaml__default["default"].stringify({
|
|
4540
|
+
steps: [
|
|
4541
|
+
{
|
|
4542
|
+
id: "publish",
|
|
4543
|
+
action: "publish:gerrit",
|
|
4544
|
+
name: "Publish to Gerrit",
|
|
4545
|
+
input: {
|
|
4546
|
+
repoUrl: "gerrit.com?repo=repo&owner=owner",
|
|
4547
|
+
description: "Initialize a gerrit repository",
|
|
4548
|
+
defaultBranch: "staging",
|
|
4549
|
+
gitCommitMessage: "Initial Commit Message",
|
|
4550
|
+
gitAuthorName: "John Doe",
|
|
4551
|
+
gitAuthorEmail: "johndoe@email.com",
|
|
4552
|
+
sourcePath: "repository/"
|
|
4553
|
+
}
|
|
4554
|
+
}
|
|
4555
|
+
]
|
|
4556
|
+
})
|
|
4557
|
+
}
|
|
4558
|
+
];
|
|
4559
|
+
|
|
4428
4560
|
const createGerritProject = async (config, options) => {
|
|
4429
4561
|
const { projectName, parent, owner, description } = options;
|
|
4430
4562
|
const fetchOptions = {
|
|
@@ -4462,6 +4594,7 @@ function createPublishGerritAction(options) {
|
|
|
4462
4594
|
return pluginScaffolderNode.createTemplateAction({
|
|
4463
4595
|
id: "publish:gerrit",
|
|
4464
4596
|
description: "Initializes a git repository of the content in the workspace, and publishes it to Gerrit.",
|
|
4597
|
+
examples: examples$3,
|
|
4465
4598
|
schema: {
|
|
4466
4599
|
input: {
|
|
4467
4600
|
type: "object",
|
|
@@ -6992,7 +7125,7 @@ class NunjucksWorkflowRunner {
|
|
|
6992
7125
|
});
|
|
6993
7126
|
}
|
|
6994
7127
|
async executeStep(task, step, context, renderTemplate, taskTrack, workspacePath, decision) {
|
|
6995
|
-
var _a, _b, _c, _d, _e
|
|
7128
|
+
var _a, _b, _c, _d, _e;
|
|
6996
7129
|
const stepTrack = await this.tracker.stepStart(task, step);
|
|
6997
7130
|
if (task.cancelSignal.aborted) {
|
|
6998
7131
|
throw new Error(`Step ${step.name} has been cancelled.`);
|
|
@@ -7042,59 +7175,61 @@ class NunjucksWorkflowRunner {
|
|
|
7042
7175
|
return;
|
|
7043
7176
|
}
|
|
7044
7177
|
}
|
|
7045
|
-
const
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
)
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7178
|
+
const iterations = (step.each ? Object.entries(this.render(step.each, context, renderTemplate)).map(
|
|
7179
|
+
([key, value]) => ({
|
|
7180
|
+
each: { key, value }
|
|
7181
|
+
})
|
|
7182
|
+
) : [{}]).map((i) => ({
|
|
7183
|
+
...i,
|
|
7184
|
+
// Secrets are only passed when templating the input to actions for security reasons
|
|
7185
|
+
input: step.input ? this.render(
|
|
7186
|
+
step.input,
|
|
7187
|
+
{ ...context, ...i, ...task },
|
|
7188
|
+
renderTemplate
|
|
7189
|
+
) : {}
|
|
7190
|
+
}));
|
|
7191
|
+
for (const iteration of iterations) {
|
|
7192
|
+
const actionId = action.id + (iteration.each ? `[${iteration.each.key}]` : "");
|
|
7193
|
+
if ((_d = action.schema) == null ? void 0 : _d.input) {
|
|
7194
|
+
const validateResult = jsonschema.validate(
|
|
7195
|
+
iteration.input,
|
|
7196
|
+
action.schema.input
|
|
7197
|
+
);
|
|
7198
|
+
if (!validateResult.valid) {
|
|
7199
|
+
const errors$1 = validateResult.errors.join(", ");
|
|
7200
|
+
throw new errors.InputError(
|
|
7201
|
+
`Invalid input passed to action ${actionId}, ${errors$1}`
|
|
7202
|
+
);
|
|
7203
|
+
}
|
|
7204
|
+
}
|
|
7205
|
+
if (!isActionAuthorized(decision, {
|
|
7206
|
+
action: action.id,
|
|
7207
|
+
input: iteration.input
|
|
7208
|
+
})) {
|
|
7209
|
+
throw new errors.NotAllowedError(
|
|
7210
|
+
`Unauthorized action: ${actionId}. The action is not allowed. Input: ${JSON.stringify(
|
|
7211
|
+
iteration.input,
|
|
7212
|
+
null,
|
|
7213
|
+
2
|
|
7214
|
+
)}`
|
|
7056
7215
|
);
|
|
7057
7216
|
}
|
|
7058
7217
|
}
|
|
7059
|
-
if (!isActionAuthorized(decision, { action: action.id, input })) {
|
|
7060
|
-
throw new errors.NotAllowedError(
|
|
7061
|
-
`Unauthorized action: ${action.id}. The action is not allowed. Input: ${JSON.stringify(
|
|
7062
|
-
input,
|
|
7063
|
-
null,
|
|
7064
|
-
2
|
|
7065
|
-
)}`
|
|
7066
|
-
);
|
|
7067
|
-
}
|
|
7068
7218
|
const tmpDirs = new Array();
|
|
7069
7219
|
const stepOutput = {};
|
|
7070
|
-
const iterations = new Array();
|
|
7071
|
-
if (step.each) {
|
|
7072
|
-
const each = await this.render(step.each, context, renderTemplate);
|
|
7073
|
-
iterations.push(
|
|
7074
|
-
...Object.keys(each).map((key) => {
|
|
7075
|
-
return { key, value: each[key] };
|
|
7076
|
-
})
|
|
7077
|
-
);
|
|
7078
|
-
} else {
|
|
7079
|
-
iterations.push({});
|
|
7080
|
-
}
|
|
7081
|
-
let actionInput = input;
|
|
7082
7220
|
for (const iteration of iterations) {
|
|
7083
|
-
if (
|
|
7084
|
-
taskLogger.info(
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
{ ...iterationContext, secrets: (_g = task.secrets) != null ? _g : {} },
|
|
7092
|
-
renderTemplate
|
|
7093
|
-
)) != null ? _h : {};
|
|
7221
|
+
if (iteration.each) {
|
|
7222
|
+
taskLogger.info(
|
|
7223
|
+
`Running step each: ${JSON.stringify(
|
|
7224
|
+
iteration.each,
|
|
7225
|
+
(k, v) => k ? v.toString() : v,
|
|
7226
|
+
0
|
|
7227
|
+
)}`
|
|
7228
|
+
);
|
|
7094
7229
|
}
|
|
7095
7230
|
await action.handler({
|
|
7096
|
-
input:
|
|
7097
|
-
secrets: (
|
|
7231
|
+
input: iteration.input,
|
|
7232
|
+
secrets: (_e = task.secrets) != null ? _e : {},
|
|
7098
7233
|
logger: taskLogger,
|
|
7099
7234
|
logStream: streamLogger,
|
|
7100
7235
|
workspacePath,
|
|
@@ -7598,6 +7733,12 @@ function buildDefaultIdentityClient(options) {
|
|
|
7598
7733
|
}
|
|
7599
7734
|
};
|
|
7600
7735
|
}
|
|
7736
|
+
const readDuration = (config$1, key, defaultValue) => {
|
|
7737
|
+
if (config$1.has(key)) {
|
|
7738
|
+
return config.readDurationFromConfig(config$1, { key });
|
|
7739
|
+
}
|
|
7740
|
+
return defaultValue;
|
|
7741
|
+
};
|
|
7601
7742
|
async function createRouter(options) {
|
|
7602
7743
|
var _a;
|
|
7603
7744
|
const router = Router__default["default"]();
|
|
@@ -7628,12 +7769,21 @@ async function createRouter(options) {
|
|
|
7628
7769
|
if (scheduler && databaseTaskStore.listStaleTasks) {
|
|
7629
7770
|
await scheduler.scheduleTask({
|
|
7630
7771
|
id: "close_stale_tasks",
|
|
7631
|
-
frequency:
|
|
7632
|
-
|
|
7772
|
+
frequency: readDuration(
|
|
7773
|
+
config,
|
|
7774
|
+
"scaffolder.taskTimeoutJanitorFrequency",
|
|
7775
|
+
{
|
|
7776
|
+
minutes: 5
|
|
7777
|
+
}
|
|
7778
|
+
),
|
|
7633
7779
|
timeout: { minutes: 15 },
|
|
7634
7780
|
fn: async () => {
|
|
7635
7781
|
const { tasks } = await databaseTaskStore.listStaleTasks({
|
|
7636
|
-
timeoutS:
|
|
7782
|
+
timeoutS: luxon.Duration.fromObject(
|
|
7783
|
+
readDuration(config, "scaffolder.taskTimeout", {
|
|
7784
|
+
hours: 24
|
|
7785
|
+
})
|
|
7786
|
+
).as("seconds")
|
|
7637
7787
|
});
|
|
7638
7788
|
for (const task of tasks) {
|
|
7639
7789
|
await databaseTaskStore.shutdownTask(task);
|
|
@@ -8035,4 +8185,4 @@ exports.createRouter = createRouter;
|
|
|
8035
8185
|
exports.createWaitAction = createWaitAction;
|
|
8036
8186
|
exports.scaffolderActionRules = scaffolderActionRules;
|
|
8037
8187
|
exports.scaffolderTemplateRules = scaffolderTemplateRules;
|
|
8038
|
-
//# sourceMappingURL=router-
|
|
8188
|
+
//# sourceMappingURL=router-6b5fa0be.cjs.js.map
|