@backstage/plugin-scaffolder-backend 1.21.0-next.2 → 1.21.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 +104 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.cjs.js +2 -1
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/cjs/{router-eac0efea.cjs.js → router-f392ade6.cjs.js} +7 -2
- package/dist/cjs/router-f392ade6.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 +21 -21
- package/package.json +26 -25
- package/dist/cjs/router-eac0efea.cjs.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,109 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend
|
|
2
2
|
|
|
3
|
+
## 1.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 458bf21: Created a gitea module for the scaffolder. This module provides a new action "publish:gitea" able to create a gitea repository owned by an organization. See: https://gitea.com/api/swagger#/organization/createOrgRepo
|
|
8
|
+
- 11b9a08: Introduced the first version of recoverable tasks.
|
|
9
|
+
- 78c100b: Support providing an overriding token for `fetch:template`, `fetch:plain` and `fetch:file` when interacting with upstream integrations
|
|
10
|
+
- e9a5228: The built-in module list has been trimmed down when using the new Backend System. Provider specific modules should now be installed with `backend.add` to provide additional actions to the scaffolder. These modules are as follows:
|
|
11
|
+
|
|
12
|
+
- `@backstage/plugin-scaffolder-backend-module-github`
|
|
13
|
+
- `@backstage/plugin-scaffolder-backend-module-gitlab`
|
|
14
|
+
- `@backstage/plugin-scaffolder-backend-module-bitbucket`
|
|
15
|
+
- `@backstage/plugin-scaffolder-backend-module-gitea`
|
|
16
|
+
- `@backstage/plugin-scaffolder-backend-module-gerrit`
|
|
17
|
+
- `@backstage/plugin-scaffolder-backend-module-confluence-to-markdown`
|
|
18
|
+
- `@backstage/plugin-scaffolder-backend-module-cookiecutter`
|
|
19
|
+
- `@backstage/plugin-scaffolder-backend-module-rails`
|
|
20
|
+
- `@backstage/plugin-scaffolder-backend-module-sentry`
|
|
21
|
+
- `@backstage/plugin-scaffolder-backend-module-yeoman`
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 5eb6882: New scaffolder module `@backstage/plugin-scaffolder-backend-module-bitbucket-server`.
|
|
26
|
+
|
|
27
|
+
Extracted from `@backstage/plugin-scaffolder-backend-module-bitbucket`
|
|
28
|
+
and replaces its actions related to Bitbucket Server.
|
|
29
|
+
|
|
30
|
+
- `publish:bitbucketServer`
|
|
31
|
+
- `publish:bitbucketServer:pull-request`
|
|
32
|
+
|
|
33
|
+
- 09f8b31: Simple typo fix in the fetch:template action example on the word 'skeleton'.
|
|
34
|
+
- c25a500: Fix some deprecations and misplaced `await` usage.
|
|
35
|
+
- f6792c6: Move the `NODE_OPTIONS` messaging for `--no-node-snapshot` to the `SecureTemplater` in order to get better messaging at runtime
|
|
36
|
+
- 9aac2b0: Use `--cwd` as the first `yarn` argument
|
|
37
|
+
- 6bb6f3e: Updated dependency `fs-extra` to `^11.2.0`.
|
|
38
|
+
Updated dependency `@types/fs-extra` to `^11.0.0`.
|
|
39
|
+
- 52ae6b9: Updated dependency `esbuild` to `^0.20.0`.
|
|
40
|
+
- 5eb6882: New scaffolder module `@backstage/plugin-scaffolder-backend-module-bitbucket-cloud`.
|
|
41
|
+
|
|
42
|
+
Extracted from `@backstage/plugin-scaffolder-backend-module-bitbucket`
|
|
43
|
+
and replaces its actions related to Bitbucket Cloud.
|
|
44
|
+
|
|
45
|
+
- `publish:bitbucketCloud`
|
|
46
|
+
- `bitbucket:pipelines:run`
|
|
47
|
+
|
|
48
|
+
- 0a395b3: Upgraded `prom-client` to version 15
|
|
49
|
+
- e1c479d: When using node 20+ the `scaffolder-backend` will now throw an error at startup if the `--no-node-snapshot` option was
|
|
50
|
+
not provided to node.
|
|
51
|
+
- e0e5afe: Add option to configure nunjucks with the `trimBlocks` and `lstripBlocks` options in the fetch:template action
|
|
52
|
+
- Updated dependencies
|
|
53
|
+
- @backstage/backend-common@0.21.0
|
|
54
|
+
- @backstage/plugin-scaffolder-backend-module-github@0.2.0
|
|
55
|
+
- @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.0
|
|
56
|
+
- @backstage/plugin-auth-node@0.4.4
|
|
57
|
+
- @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.0
|
|
58
|
+
- @backstage/plugin-scaffolder-backend-module-gerrit@0.1.2
|
|
59
|
+
- @backstage/plugin-scaffolder-backend-module-gitlab@0.2.13
|
|
60
|
+
- @backstage/plugin-scaffolder-backend-module-azure@0.1.2
|
|
61
|
+
- @backstage/backend-plugin-api@0.6.10
|
|
62
|
+
- @backstage/backend-tasks@0.5.15
|
|
63
|
+
- @backstage/catalog-model@1.4.4
|
|
64
|
+
- @backstage/integration@1.9.0
|
|
65
|
+
- @backstage/catalog-client@1.6.0
|
|
66
|
+
- @backstage/plugin-scaffolder-backend-module-gitea@0.1.0
|
|
67
|
+
- @backstage/plugin-scaffolder-node@0.3.0
|
|
68
|
+
- @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.7
|
|
69
|
+
- @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.0
|
|
70
|
+
- @backstage/plugin-scaffolder-common@1.5.0
|
|
71
|
+
- @backstage/plugin-catalog-node@1.7.0
|
|
72
|
+
- @backstage/plugin-permission-node@0.7.21
|
|
73
|
+
- @backstage/config@1.1.1
|
|
74
|
+
- @backstage/errors@1.2.3
|
|
75
|
+
- @backstage/types@1.1.1
|
|
76
|
+
- @backstage/plugin-permission-common@0.7.12
|
|
77
|
+
|
|
78
|
+
## 1.21.0-next.3
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- Updated dependencies
|
|
83
|
+
- @backstage/backend-common@0.21.0-next.3
|
|
84
|
+
- @backstage/plugin-scaffolder-backend-module-gitlab@0.2.13-next.3
|
|
85
|
+
- @backstage/integration@1.9.0-next.1
|
|
86
|
+
- @backstage/backend-tasks@0.5.15-next.3
|
|
87
|
+
- @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.1.7-next.3
|
|
88
|
+
- @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.1.0-next.1
|
|
89
|
+
- @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.1.0-next.1
|
|
90
|
+
- @backstage/plugin-scaffolder-backend-module-bitbucket@0.2.0-next.3
|
|
91
|
+
- @backstage/plugin-scaffolder-backend-module-gerrit@0.1.2-next.3
|
|
92
|
+
- @backstage/plugin-scaffolder-backend-module-github@0.2.0-next.3
|
|
93
|
+
- @backstage/plugin-scaffolder-backend-module-azure@0.1.2-next.3
|
|
94
|
+
- @backstage/plugin-catalog-node@1.6.2-next.3
|
|
95
|
+
- @backstage/plugin-auth-node@0.4.4-next.3
|
|
96
|
+
- @backstage/plugin-permission-node@0.7.21-next.3
|
|
97
|
+
- @backstage/plugin-scaffolder-node@0.3.0-next.3
|
|
98
|
+
- @backstage/backend-plugin-api@0.6.10-next.3
|
|
99
|
+
- @backstage/catalog-client@1.6.0-next.1
|
|
100
|
+
- @backstage/catalog-model@1.4.4-next.0
|
|
101
|
+
- @backstage/config@1.1.1
|
|
102
|
+
- @backstage/errors@1.2.3
|
|
103
|
+
- @backstage/types@1.1.1
|
|
104
|
+
- @backstage/plugin-permission-common@0.7.12
|
|
105
|
+
- @backstage/plugin-scaffolder-common@1.5.0-next.1
|
|
106
|
+
|
|
3
107
|
## 1.21.0-next.2
|
|
4
108
|
|
|
5
109
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var alpha = require('@backstage/plugin-scaffolder-common/alpha');
|
|
6
6
|
var pluginPermissionNode = require('@backstage/plugin-permission-node');
|
|
7
|
-
var router = require('./cjs/router-
|
|
7
|
+
var router = require('./cjs/router-f392ade6.cjs.js');
|
|
8
8
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
9
9
|
var backendCommon = require('@backstage/backend-common');
|
|
10
10
|
var integration = require('@backstage/integration');
|
|
@@ -17,6 +17,7 @@ require('@backstage/plugin-scaffolder-backend-module-bitbucket-cloud');
|
|
|
17
17
|
require('@backstage/plugin-scaffolder-backend-module-bitbucket-server');
|
|
18
18
|
require('@backstage/plugin-scaffolder-backend-module-gerrit');
|
|
19
19
|
require('@backstage/plugin-scaffolder-backend-module-gitlab');
|
|
20
|
+
require('@backstage/plugin-scaffolder-backend-module-gitea');
|
|
20
21
|
require('@backstage/errors');
|
|
21
22
|
require('zen-observable');
|
|
22
23
|
require('@backstage/config');
|
package/dist/alpha.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.cjs.js","sources":["../src/service/conditionExports.ts","../src/ScaffolderPlugin.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n RESOURCE_TYPE_SCAFFOLDER_ACTION,\n} from '@backstage/plugin-scaffolder-common/alpha';\nimport { createConditionExports } from '@backstage/plugin-permission-node';\nimport { scaffolderTemplateRules, scaffolderActionRules } from './rules';\n\nconst templateConditionExports = createConditionExports({\n pluginId: 'scaffolder',\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n rules: scaffolderTemplateRules,\n});\n\nconst actionsConditionExports = createConditionExports({\n pluginId: 'scaffolder',\n resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION,\n rules: scaffolderActionRules,\n});\n\n/**\n * `createScaffolderTemplateConditionalDecision` can be used when authoring policies to\n * create conditional decisions. It requires a permission of type\n * `ResourcePermission<'scaffolder-template'>` to be passed as the first parameter.\n * It's recommended that you use the provided `isResourcePermission` and\n * `isPermission` helper methods to narrow the type of the permission passed to\n * the handle method as shown below.\n *\n * ```\n * // MyAuthorizationPolicy.ts\n * ...\n * import { createScaffolderPolicyDecision } from '@backstage/plugin-scaffolder-backend';\n * import { RESOURCE_TYPE_SCAFFOLDER_TEMPLATE } from '@backstage/plugin-scaffolder-common';\n *\n * class MyAuthorizationPolicy implements PermissionPolicy {\n * async handle(request, user) {\n * ...\n *\n * if (isResourcePermission(request.permission, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE)) {\n * return createScaffolderConditionalDecision(\n * request.permission,\n * { anyOf: [...insert conditions here...] }\n * );\n * }\n *\n * ...\n * }\n *\n * ```\n *\n * @alpha\n */\nexport const createScaffolderTemplateConditionalDecision =\n templateConditionExports.createConditionalDecision;\n\n/**\n * These conditions are used when creating conditional decisions for scaffolder\n * templates that are returned by authorization policies.\n *\n * @alpha\n */\nexport const scaffolderTemplateConditions = templateConditionExports.conditions;\n\n/**\n * @alpha\n */\nexport const createScaffolderActionConditionalDecision =\n actionsConditionExports.createConditionalDecision;\n\n/**\n *\n * These conditions are used when creating conditional decisions for scaffolder\n * actions that are returned by authorization policies.\n *\n * @alpha\n */\nexport const scaffolderActionConditions = actionsConditionExports.conditions;\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createBackendPlugin,\n coreServices,\n} from '@backstage/backend-plugin-api';\nimport { loggerToWinstonLogger } from '@backstage/backend-common';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';\nimport {\n TaskBroker,\n TemplateAction,\n TemplateFilter,\n TemplateGlobal,\n} from '@backstage/plugin-scaffolder-node';\nimport {\n scaffolderActionsExtensionPoint,\n scaffolderTaskBrokerExtensionPoint,\n scaffolderTemplatingExtensionPoint,\n} from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createCatalogRegisterAction,\n createCatalogWriteAction,\n createDebugLogAction,\n createFetchCatalogEntityAction,\n createFetchPlainAction,\n createFetchPlainFileAction,\n createFetchTemplateAction,\n createFilesystemDeleteAction,\n createFilesystemRenameAction,\n createWaitAction,\n} from './scaffolder';\nimport { createRouter } from './service/router';\n\n/**\n * Scaffolder plugin\n *\n * @alpha\n */\nexport const scaffolderPlugin = createBackendPlugin({\n pluginId: 'scaffolder',\n register(env) {\n const addedActions = new Array<TemplateAction<any, any>>();\n env.registerExtensionPoint(scaffolderActionsExtensionPoint, {\n addActions(...newActions: TemplateAction<any>[]) {\n addedActions.push(...newActions);\n },\n });\n\n let taskBroker: TaskBroker | undefined;\n env.registerExtensionPoint(scaffolderTaskBrokerExtensionPoint, {\n setTaskBroker(newTaskBroker) {\n if (taskBroker) {\n throw new Error('Task broker may only be set once');\n }\n taskBroker = newTaskBroker;\n },\n });\n\n const additionalTemplateFilters: Record<string, TemplateFilter> = {};\n const additionalTemplateGlobals: Record<string, TemplateGlobal> = {};\n env.registerExtensionPoint(scaffolderTemplatingExtensionPoint, {\n addTemplateFilters(newFilters) {\n Object.assign(additionalTemplateFilters, newFilters);\n },\n addTemplateGlobals(newGlobals) {\n Object.assign(additionalTemplateGlobals, newGlobals);\n },\n });\n\n env.registerInit({\n deps: {\n logger: coreServices.logger,\n config: coreServices.rootConfig,\n lifecycle: coreServices.rootLifecycle,\n reader: coreServices.urlReader,\n permissions: coreServices.permissions,\n database: coreServices.database,\n httpRouter: coreServices.httpRouter,\n catalogClient: catalogServiceRef,\n },\n async init({\n logger,\n config,\n lifecycle,\n reader,\n database,\n httpRouter,\n catalogClient,\n permissions,\n }) {\n const log = loggerToWinstonLogger(logger);\n const integrations = ScmIntegrations.fromConfig(config);\n\n const actions = [\n // actions provided from other modules\n ...addedActions,\n\n // built-in actions for the scaffolder\n createFetchPlainAction({\n reader,\n integrations,\n }),\n createFetchPlainFileAction({\n reader,\n integrations,\n }),\n createFetchTemplateAction({\n integrations,\n reader,\n additionalTemplateFilters,\n additionalTemplateGlobals,\n }),\n createDebugLogAction(),\n createWaitAction(),\n // todo(blam): maybe these should be a -catalog module?\n createCatalogRegisterAction({ catalogClient, integrations }),\n createFetchCatalogEntityAction({ catalogClient }),\n createCatalogWriteAction(),\n createFilesystemDeleteAction(),\n createFilesystemRenameAction(),\n ];\n\n const actionIds = actions.map(action => action.id).join(', ');\n\n log.info(\n `Starting scaffolder with the following actions enabled ${actionIds}`,\n );\n\n const router = await createRouter({\n logger: log,\n config,\n database,\n catalogClient,\n reader,\n lifecycle,\n actions,\n taskBroker,\n additionalTemplateFilters,\n additionalTemplateGlobals,\n permissions,\n });\n httpRouter.use(router);\n },\n });\n },\n});\n"],"names":["createConditionExports","RESOURCE_TYPE_SCAFFOLDER_TEMPLATE","scaffolderTemplateRules","RESOURCE_TYPE_SCAFFOLDER_ACTION","scaffolderActionRules","createBackendPlugin","scaffolderActionsExtensionPoint","scaffolderTaskBrokerExtensionPoint","scaffolderTemplatingExtensionPoint","coreServices","catalogServiceRef","loggerToWinstonLogger","ScmIntegrations","createFetchPlainAction","createFetchPlainFileAction","createFetchTemplateAction","createDebugLogAction","createWaitAction","createCatalogRegisterAction","createFetchCatalogEntityAction","createCatalogWriteAction","createFilesystemDeleteAction","createFilesystemRenameAction","router","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AAA;AAAA,YACA,yBAAA;AAAA,YACA,yBAAA;AAAA,WACD,CAAA;AAAA,UACDC,2BAAqB,EAAA;AAAA,UACrBC,uBAAiB,EAAA;AAAA;AAAA,UAEjBC,kCAA4B,CAAA,EAAE,aAAe,EAAA,YAAA,EAAc,CAAA;AAAA,UAC3DC,qCAAA,CAA+B,EAAE,aAAA,EAAe,CAAA;AAAA,UAChDC,+BAAyB,EAAA;AAAA,UACzBC,mCAA6B,EAAA;AAAA,UAC7BC,mCAA6B,EAAA;AAAA,SAC/B,CAAA;AAEA,QAAM,MAAA,SAAA,GAAY,QAAQ,GAAI,CAAA,CAAA,MAAA,KAAU,OAAO,EAAE,CAAA,CAAE,KAAK,IAAI,CAAA,CAAA;AAE5D,QAAI,GAAA,CAAA,IAAA;AAAA,UACF,0DAA0D,SAAS,CAAA,CAAA;AAAA,SACrE,CAAA;AAEA,QAAM,MAAAC,QAAA,GAAS,MAAMC,mBAAa,CAAA;AAAA,UAChC,MAAQ,EAAA,GAAA;AAAA,UACR,MAAA;AAAA,UACA,QAAA;AAAA,UACA,aAAA;AAAA,UACA,MAAA;AAAA,UACA,SAAA;AAAA,UACA,OAAA;AAAA,UACA,UAAA;AAAA,UACA,yBAAA;AAAA,UACA,yBAAA;AAAA,UACA,WAAA;AAAA,SACD,CAAA,CAAA;AACD,QAAA,UAAA,CAAW,IAAID,QAAM,CAAA,CAAA;AAAA,OACvB;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"alpha.cjs.js","sources":["../src/service/conditionExports.ts","../src/ScaffolderPlugin.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n RESOURCE_TYPE_SCAFFOLDER_ACTION,\n} from '@backstage/plugin-scaffolder-common/alpha';\nimport { createConditionExports } from '@backstage/plugin-permission-node';\nimport { scaffolderTemplateRules, scaffolderActionRules } from './rules';\n\nconst templateConditionExports = createConditionExports({\n pluginId: 'scaffolder',\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n rules: scaffolderTemplateRules,\n});\n\nconst actionsConditionExports = createConditionExports({\n pluginId: 'scaffolder',\n resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION,\n rules: scaffolderActionRules,\n});\n\n/**\n * `createScaffolderTemplateConditionalDecision` can be used when authoring policies to\n * create conditional decisions. It requires a permission of type\n * `ResourcePermission<'scaffolder-template'>` to be passed as the first parameter.\n * It's recommended that you use the provided `isResourcePermission` and\n * `isPermission` helper methods to narrow the type of the permission passed to\n * the handle method as shown below.\n *\n * ```\n * // MyAuthorizationPolicy.ts\n * ...\n * import { createScaffolderPolicyDecision } from '@backstage/plugin-scaffolder-backend';\n * import { RESOURCE_TYPE_SCAFFOLDER_TEMPLATE } from '@backstage/plugin-scaffolder-common';\n *\n * class MyAuthorizationPolicy implements PermissionPolicy {\n * async handle(request, user) {\n * ...\n *\n * if (isResourcePermission(request.permission, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE)) {\n * return createScaffolderConditionalDecision(\n * request.permission,\n * { anyOf: [...insert conditions here...] }\n * );\n * }\n *\n * ...\n * }\n *\n * ```\n *\n * @alpha\n */\nexport const createScaffolderTemplateConditionalDecision =\n templateConditionExports.createConditionalDecision;\n\n/**\n * These conditions are used when creating conditional decisions for scaffolder\n * templates that are returned by authorization policies.\n *\n * @alpha\n */\nexport const scaffolderTemplateConditions = templateConditionExports.conditions;\n\n/**\n * @alpha\n */\nexport const createScaffolderActionConditionalDecision =\n actionsConditionExports.createConditionalDecision;\n\n/**\n *\n * These conditions are used when creating conditional decisions for scaffolder\n * actions that are returned by authorization policies.\n *\n * @alpha\n */\nexport const scaffolderActionConditions = actionsConditionExports.conditions;\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createBackendPlugin,\n coreServices,\n} from '@backstage/backend-plugin-api';\nimport { loggerToWinstonLogger } from '@backstage/backend-common';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';\nimport {\n TaskBroker,\n TemplateAction,\n TemplateFilter,\n TemplateGlobal,\n} from '@backstage/plugin-scaffolder-node';\nimport {\n scaffolderActionsExtensionPoint,\n scaffolderTaskBrokerExtensionPoint,\n scaffolderTemplatingExtensionPoint,\n} from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createCatalogRegisterAction,\n createCatalogWriteAction,\n createDebugLogAction,\n createFetchCatalogEntityAction,\n createFetchPlainAction,\n createFetchPlainFileAction,\n createFetchTemplateAction,\n createFilesystemDeleteAction,\n createFilesystemRenameAction,\n createWaitAction,\n} from './scaffolder';\nimport { createRouter } from './service/router';\n\n/**\n * Scaffolder plugin\n *\n * @alpha\n */\nexport const scaffolderPlugin = createBackendPlugin({\n pluginId: 'scaffolder',\n register(env) {\n const addedActions = new Array<TemplateAction<any, any>>();\n env.registerExtensionPoint(scaffolderActionsExtensionPoint, {\n addActions(...newActions: TemplateAction<any>[]) {\n addedActions.push(...newActions);\n },\n });\n\n let taskBroker: TaskBroker | undefined;\n env.registerExtensionPoint(scaffolderTaskBrokerExtensionPoint, {\n setTaskBroker(newTaskBroker) {\n if (taskBroker) {\n throw new Error('Task broker may only be set once');\n }\n taskBroker = newTaskBroker;\n },\n });\n\n const additionalTemplateFilters: Record<string, TemplateFilter> = {};\n const additionalTemplateGlobals: Record<string, TemplateGlobal> = {};\n env.registerExtensionPoint(scaffolderTemplatingExtensionPoint, {\n addTemplateFilters(newFilters) {\n Object.assign(additionalTemplateFilters, newFilters);\n },\n addTemplateGlobals(newGlobals) {\n Object.assign(additionalTemplateGlobals, newGlobals);\n },\n });\n\n env.registerInit({\n deps: {\n logger: coreServices.logger,\n config: coreServices.rootConfig,\n lifecycle: coreServices.rootLifecycle,\n reader: coreServices.urlReader,\n permissions: coreServices.permissions,\n database: coreServices.database,\n httpRouter: coreServices.httpRouter,\n catalogClient: catalogServiceRef,\n },\n async init({\n logger,\n config,\n lifecycle,\n reader,\n database,\n httpRouter,\n catalogClient,\n permissions,\n }) {\n const log = loggerToWinstonLogger(logger);\n const integrations = ScmIntegrations.fromConfig(config);\n\n const actions = [\n // actions provided from other modules\n ...addedActions,\n\n // built-in actions for the scaffolder\n createFetchPlainAction({\n reader,\n integrations,\n }),\n createFetchPlainFileAction({\n reader,\n integrations,\n }),\n createFetchTemplateAction({\n integrations,\n reader,\n additionalTemplateFilters,\n additionalTemplateGlobals,\n }),\n createDebugLogAction(),\n createWaitAction(),\n // todo(blam): maybe these should be a -catalog module?\n createCatalogRegisterAction({ catalogClient, integrations }),\n createFetchCatalogEntityAction({ catalogClient }),\n createCatalogWriteAction(),\n createFilesystemDeleteAction(),\n createFilesystemRenameAction(),\n ];\n\n const actionIds = actions.map(action => action.id).join(', ');\n\n log.info(\n `Starting scaffolder with the following actions enabled ${actionIds}`,\n );\n\n const router = await createRouter({\n logger: log,\n config,\n database,\n catalogClient,\n reader,\n lifecycle,\n actions,\n taskBroker,\n additionalTemplateFilters,\n additionalTemplateGlobals,\n permissions,\n });\n httpRouter.use(router);\n },\n });\n },\n});\n"],"names":["createConditionExports","RESOURCE_TYPE_SCAFFOLDER_TEMPLATE","scaffolderTemplateRules","RESOURCE_TYPE_SCAFFOLDER_ACTION","scaffolderActionRules","createBackendPlugin","scaffolderActionsExtensionPoint","scaffolderTaskBrokerExtensionPoint","scaffolderTemplatingExtensionPoint","coreServices","catalogServiceRef","loggerToWinstonLogger","ScmIntegrations","createFetchPlainAction","createFetchPlainFileAction","createFetchTemplateAction","createDebugLogAction","createWaitAction","createCatalogRegisterAction","createFetchCatalogEntityAction","createCatalogWriteAction","createFilesystemDeleteAction","createFilesystemRenameAction","router","createRouter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,2BAA2BA,2CAAuB,CAAA;AAAA,EACtD,QAAU,EAAA,YAAA;AAAA,EACV,YAAc,EAAAC,uCAAA;AAAA,EACd,KAAO,EAAAC,8BAAA;AACT,CAAC,CAAA,CAAA;AAED,MAAM,0BAA0BF,2CAAuB,CAAA;AAAA,EACrD,QAAU,EAAA,YAAA;AAAA,EACV,YAAc,EAAAG,qCAAA;AAAA,EACd,KAAO,EAAAC,4BAAA;AACT,CAAC,CAAA,CAAA;AAkCM,MAAM,8CACX,wBAAyB,CAAA,0BAAA;AAQpB,MAAM,+BAA+B,wBAAyB,CAAA,WAAA;AAK9D,MAAM,4CACX,uBAAwB,CAAA,0BAAA;AASnB,MAAM,6BAA6B,uBAAwB,CAAA;;ACtC3D,MAAM,mBAAmBC,oCAAoB,CAAA;AAAA,EAClD,QAAU,EAAA,YAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAM,MAAA,YAAA,GAAe,IAAI,KAAgC,EAAA,CAAA;AACzD,IAAA,GAAA,CAAI,uBAAuBC,uCAAiC,EAAA;AAAA,MAC1D,cAAc,UAAmC,EAAA;AAC/C,QAAa,YAAA,CAAA,IAAA,CAAK,GAAG,UAAU,CAAA,CAAA;AAAA,OACjC;AAAA,KACD,CAAA,CAAA;AAED,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A,OACvB;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;;;"}
|
|
@@ -27,6 +27,7 @@ var bitbucketCloud = require('@backstage/plugin-scaffolder-backend-module-bitbuc
|
|
|
27
27
|
var bitbucketServer = require('@backstage/plugin-scaffolder-backend-module-bitbucket-server');
|
|
28
28
|
var gerrit = require('@backstage/plugin-scaffolder-backend-module-gerrit');
|
|
29
29
|
var gitlab = require('@backstage/plugin-scaffolder-backend-module-gitlab');
|
|
30
|
+
var pluginScaffolderBackendModuleGitea = require('@backstage/plugin-scaffolder-backend-module-gitea');
|
|
30
31
|
var uuid = require('uuid');
|
|
31
32
|
var ObservableImpl = require('zen-observable');
|
|
32
33
|
var lodash = require('lodash');
|
|
@@ -1347,6 +1348,10 @@ const createBuiltinActions = (options) => {
|
|
|
1347
1348
|
integrations,
|
|
1348
1349
|
config
|
|
1349
1350
|
}),
|
|
1351
|
+
pluginScaffolderBackendModuleGitea.createPublishGiteaAction({
|
|
1352
|
+
integrations,
|
|
1353
|
+
config
|
|
1354
|
+
}),
|
|
1350
1355
|
github.createPublishGithubAction({
|
|
1351
1356
|
integrations,
|
|
1352
1357
|
config,
|
|
@@ -2313,7 +2318,7 @@ class NunjucksWorkflowRunner {
|
|
|
2313
2318
|
}
|
|
2314
2319
|
try {
|
|
2315
2320
|
if (step.if) {
|
|
2316
|
-
const ifResult =
|
|
2321
|
+
const ifResult = this.render(step.if, context, renderTemplate);
|
|
2317
2322
|
if (!isTruthy(ifResult)) {
|
|
2318
2323
|
await stepTrack.skipFalsy();
|
|
2319
2324
|
return;
|
|
@@ -3384,4 +3389,4 @@ exports.createRouter = createRouter;
|
|
|
3384
3389
|
exports.createWaitAction = createWaitAction;
|
|
3385
3390
|
exports.scaffolderActionRules = scaffolderActionRules;
|
|
3386
3391
|
exports.scaffolderTemplateRules = scaffolderTemplateRules;
|
|
3387
|
-
//# sourceMappingURL=router-
|
|
3392
|
+
//# sourceMappingURL=router-f392ade6.cjs.js.map
|