@backstage/plugin-scaffolder-backend-module-gitea 0.2.11 → 0.2.12
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
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-gitea
|
|
2
2
|
|
|
3
|
+
## 0.2.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/plugin-scaffolder-node@0.11.0
|
|
9
|
+
- @backstage/backend-plugin-api@1.4.2
|
|
10
|
+
|
|
11
|
+
## 0.2.12-next.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @backstage/plugin-scaffolder-node@0.11.0-next.0
|
|
17
|
+
- @backstage/backend-plugin-api@1.4.2-next.0
|
|
18
|
+
- @backstage/config@1.3.3
|
|
19
|
+
- @backstage/errors@1.2.7
|
|
20
|
+
- @backstage/integration@1.17.1
|
|
21
|
+
|
|
3
22
|
## 0.2.11
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitea.cjs.js","sources":["../../src/actions/gitea.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { InputError } from '@backstage/errors';\nimport { Config } from '@backstage/config';\nimport {\n getGiteaRequestOptions,\n GiteaIntegrationConfig,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n ActionContext,\n createTemplateAction,\n getRepoSourceDirectory,\n initRepoAndPush,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { examples } from './gitea.examples';\nimport crypto from 'crypto';\n\nconst checkGiteaContentUrl = async (\n config: GiteaIntegrationConfig,\n options: {\n owner?: string;\n repo: string;\n defaultBranch?: string;\n },\n): Promise<Response> => {\n const { owner, repo, defaultBranch } = options;\n let response: Response;\n const getOptions: RequestInit = {\n method: 'GET',\n };\n\n try {\n response = await fetch(\n `${config.baseUrl}/${owner}/${repo}/src/branch/${defaultBranch}`,\n getOptions,\n );\n } catch (e) {\n throw new Error(\n `Unable to get the repository: ${owner}/${repo} metadata , ${e}`,\n );\n }\n return response;\n};\n\nconst checkGiteaOrg = async (\n config: GiteaIntegrationConfig,\n options: {\n owner: string;\n },\n): Promise<void> => {\n const { owner } = options;\n let response: Response;\n // check first if the org = owner exists\n const getOptions: RequestInit = {\n method: 'GET',\n headers: {\n ...getGiteaRequestOptions(config).headers,\n 'Content-Type': 'application/json',\n },\n };\n try {\n response = await fetch(\n `${config.baseUrl}/api/v1/orgs/${owner}`,\n getOptions,\n );\n } catch (e) {\n throw new Error(\n `Unable to get the Organization: ${owner}; Error cause: ${e.message}, code: ${e.cause.code}`,\n );\n }\n if (response.status !== 200) {\n throw new Error(\n `Organization ${owner} do not exist. Please create it first !`,\n );\n }\n};\n\nconst createGiteaProject = async (\n config: GiteaIntegrationConfig,\n options: {\n projectName: string;\n owner?: string;\n repoVisibility?: string;\n description: string;\n },\n): Promise<void> => {\n const { projectName, description, owner, repoVisibility } = options;\n\n /*\n Several options exist to create a repository using either the user or organisation\n User: https://gitea.com/api/swagger#/user/createCurrentUserRepo\n Api: URL/api/v1/user/repos\n Remark: The user is the username defined part of the backstage integration config for the gitea URL !\n\n Org: https://gitea.com/api/swagger#/organization/createOrgRepo\n Api: URL/api/v1/orgs/${org_owner}/repos\n This is the default scenario that we support currently\n */\n let response: Response;\n let isPrivate: boolean;\n\n if (repoVisibility === 'private') {\n isPrivate = true;\n } else if (repoVisibility === 'public') {\n isPrivate = false;\n } else {\n // Provide a default value if repoVisibility is neither \"private\" nor \"public\"\n isPrivate = false;\n }\n\n const postOptions: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n name: projectName,\n description,\n private: isPrivate,\n }),\n headers: {\n ...getGiteaRequestOptions(config).headers,\n 'Content-Type': 'application/json',\n },\n };\n try {\n response = await fetch(\n `${config.baseUrl}/api/v1/orgs/${owner}/repos`,\n postOptions,\n );\n } catch (e) {\n throw new Error(`Unable to create repository, ${e}`);\n }\n if (response.status !== 201) {\n throw new Error(\n `Unable to create repository, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n};\n\nconst generateCommitMessage = (\n config: Config,\n commitSubject?: string,\n): string => {\n const changeId = crypto.randomBytes(20).toString('hex');\n const msg = `${\n config.getOptionalString('scaffolder.defaultCommitMessage') || commitSubject\n }\\n\\nChange-Id: I${changeId}`;\n return msg;\n};\n\nasync function checkAvailabilityGiteaRepository(\n maxDuration: number,\n integrationConfig: GiteaIntegrationConfig,\n options: {\n owner?: string;\n repo: string;\n defaultBranch: string;\n ctx: ActionContext<any, any, any>;\n },\n) {\n const startTimestamp = Date.now();\n\n const { owner, repo, defaultBranch, ctx } = options;\n const sleep = (ms: number | undefined) => new Promise(r => setTimeout(r, ms));\n let response: Response;\n\n while (Date.now() - startTimestamp < maxDuration) {\n if (ctx.signal?.aborted) return;\n\n response = await checkGiteaContentUrl(integrationConfig, {\n owner,\n repo,\n defaultBranch,\n });\n\n if (response.status !== 200) {\n // Repository is not yet available/accessible ...\n await sleep(1000);\n } else {\n // Gitea repository exists !\n break;\n }\n }\n}\n\n/**\n * Creates a new action that initializes a git repository using the content of the workspace.\n * and publishes it to a Gitea instance.\n * @public\n */\nexport function createPublishGiteaAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction({\n id: 'publish:gitea',\n description:\n 'Initializes a git repository using the content of the workspace, and publishes it to Gitea.',\n examples,\n schema: {\n input: {\n repoUrl: z =>\n z.string({\n description: 'Repository Location',\n }),\n description: z =>\n z.string({\n description: 'Repository Description',\n }),\n defaultBranch: z =>\n z\n .string({\n description: `Sets the default branch on the repository. The default value is 'main'`,\n })\n .optional(),\n repoVisibility: z =>\n z\n .enum(['private', 'public'], {\n description: `Sets the visibility of the repository. The default value is 'public'.`,\n })\n .optional(),\n gitCommitMessage: z =>\n z\n .string({\n description: `Sets the commit message on the repository. The default value is 'initial commit'`,\n })\n .optional(),\n gitAuthorName: z =>\n z\n .string({\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n })\n .optional(),\n gitAuthorEmail: z =>\n z\n .string({\n description: `Sets the default author email for the commit.`,\n })\n .optional(),\n sourcePath: z =>\n z\n .string({\n description: `Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.`,\n })\n .optional(),\n signCommit: z =>\n z\n .boolean({\n description: 'Sign commit with configured PGP private key',\n })\n .optional(),\n },\n output: {\n remoteUrl: z =>\n z\n .string({\n description: 'A URL to the repository with the provider',\n })\n .optional(),\n repoContentsUrl: z =>\n z\n .string({\n description: 'A URL to the root of the repository',\n })\n .optional(),\n commitHash: z =>\n z\n .string({\n description: 'The git commit hash of the initial commit',\n })\n .optional(),\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n description,\n defaultBranch = 'main',\n repoVisibility = 'public',\n gitAuthorName,\n gitAuthorEmail,\n gitCommitMessage = 'initial commit',\n sourcePath,\n signCommit,\n } = ctx.input;\n\n const { repo, host, owner } = parseRepoUrl(repoUrl, integrations);\n\n const integrationConfig = integrations.gitea.byHost(host);\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n const { username, password } = integrationConfig.config;\n\n if (!username || !password) {\n throw new Error('Credentials for the gitea ${host} required.');\n }\n\n // check if the org exists within the gitea server\n if (owner) {\n await checkGiteaOrg(integrationConfig.config, { owner });\n }\n\n await createGiteaProject(integrationConfig.config, {\n description,\n repoVisibility,\n owner: owner,\n projectName: repo,\n });\n\n const auth = {\n username: username,\n password: password,\n };\n const gitAuthorInfo = {\n name: gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n const signingKey =\n integrationConfig.config.commitSigningKey ??\n config.getOptionalString('scaffolder.defaultCommitSigningKey');\n if (signCommit && !signingKey) {\n throw new Error(\n 'Signing commits is enabled but no signing key is provided in the configuration',\n );\n }\n\n // The owner to be used should be either the org name or user authenticated with the gitea server\n const remoteUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}.git`;\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: generateCommitMessage(config, gitCommitMessage),\n gitAuthorInfo,\n });\n\n // Check if the gitea repo URL is available before to exit\n const maxDuration = 20000; // 20 seconds\n await checkAvailabilityGiteaRepository(\n maxDuration,\n integrationConfig.config,\n {\n owner,\n repo,\n defaultBranch,\n ctx,\n },\n );\n\n const repoContentsUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}/src/branch/${defaultBranch}/`;\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n"],"names":["getGiteaRequestOptions","crypto","createTemplateAction","examples","parseRepoUrl","InputError","initRepoAndPush","getRepoSourceDirectory"],"mappings":";;;;;;;;;;;;AAiCA,MAAM,oBAAA,GAAuB,OAC3B,MAAA,EACA,OAKsB,KAAA;AACtB,EAAA,MAAM,EAAE,KAAA,EAAO,IAAM,EAAA,aAAA,EAAkB,GAAA,OAAA;AACvC,EAAI,IAAA,QAAA;AACJ,EAAA,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AAA,OAAO,IAAI,KAAK,CAAA,CAAA,EAAI,IAAI,CAAA,YAAA,EAAe,aAAa,CAAA,CAAA,CAAA;AACxG,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA;AACjC,MAAI,GAAA,CAAA,MAAA,CAAO,YAAc,EAAA,YAAA,EAAc,UAAU,CAAA;AACjD,MAAI,GAAA,CAAA,MAAA,CAAO,mBAAmB,eAAe,CAAA;AAAA;AAC/C,GACD,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"gitea.cjs.js","sources":["../../src/actions/gitea.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { InputError } from '@backstage/errors';\nimport { Config } from '@backstage/config';\nimport {\n getGiteaRequestOptions,\n GiteaIntegrationConfig,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n ActionContext,\n createTemplateAction,\n getRepoSourceDirectory,\n initRepoAndPush,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { examples } from './gitea.examples';\nimport crypto from 'crypto';\n\nconst checkGiteaContentUrl = async (\n config: GiteaIntegrationConfig,\n options: {\n owner?: string;\n repo: string;\n defaultBranch?: string;\n },\n): Promise<Response> => {\n const { owner, repo, defaultBranch } = options;\n let response: Response;\n const getOptions: RequestInit = {\n method: 'GET',\n };\n\n try {\n response = await fetch(\n `${config.baseUrl}/${owner}/${repo}/src/branch/${defaultBranch}`,\n getOptions,\n );\n } catch (e) {\n throw new Error(\n `Unable to get the repository: ${owner}/${repo} metadata , ${e}`,\n );\n }\n return response;\n};\n\nconst checkGiteaOrg = async (\n config: GiteaIntegrationConfig,\n options: {\n owner: string;\n },\n): Promise<void> => {\n const { owner } = options;\n let response: Response;\n // check first if the org = owner exists\n const getOptions: RequestInit = {\n method: 'GET',\n headers: {\n ...getGiteaRequestOptions(config).headers,\n 'Content-Type': 'application/json',\n },\n };\n try {\n response = await fetch(\n `${config.baseUrl}/api/v1/orgs/${owner}`,\n getOptions,\n );\n } catch (e) {\n throw new Error(\n `Unable to get the Organization: ${owner}; Error cause: ${e.message}, code: ${e.cause.code}`,\n );\n }\n if (response.status !== 200) {\n throw new Error(\n `Organization ${owner} do not exist. Please create it first !`,\n );\n }\n};\n\nconst createGiteaProject = async (\n config: GiteaIntegrationConfig,\n options: {\n projectName: string;\n owner?: string;\n repoVisibility?: string;\n description: string;\n },\n): Promise<void> => {\n const { projectName, description, owner, repoVisibility } = options;\n\n /*\n Several options exist to create a repository using either the user or organisation\n User: https://gitea.com/api/swagger#/user/createCurrentUserRepo\n Api: URL/api/v1/user/repos\n Remark: The user is the username defined part of the backstage integration config for the gitea URL !\n\n Org: https://gitea.com/api/swagger#/organization/createOrgRepo\n Api: URL/api/v1/orgs/${org_owner}/repos\n This is the default scenario that we support currently\n */\n let response: Response;\n let isPrivate: boolean;\n\n if (repoVisibility === 'private') {\n isPrivate = true;\n } else if (repoVisibility === 'public') {\n isPrivate = false;\n } else {\n // Provide a default value if repoVisibility is neither \"private\" nor \"public\"\n isPrivate = false;\n }\n\n const postOptions: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n name: projectName,\n description,\n private: isPrivate,\n }),\n headers: {\n ...getGiteaRequestOptions(config).headers,\n 'Content-Type': 'application/json',\n },\n };\n try {\n response = await fetch(\n `${config.baseUrl}/api/v1/orgs/${owner}/repos`,\n postOptions,\n );\n } catch (e) {\n throw new Error(`Unable to create repository, ${e}`);\n }\n if (response.status !== 201) {\n throw new Error(\n `Unable to create repository, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n};\n\nconst generateCommitMessage = (\n config: Config,\n commitSubject?: string,\n): string => {\n const changeId = crypto.randomBytes(20).toString('hex');\n const msg = `${\n config.getOptionalString('scaffolder.defaultCommitMessage') || commitSubject\n }\\n\\nChange-Id: I${changeId}`;\n return msg;\n};\n\nasync function checkAvailabilityGiteaRepository(\n maxDuration: number,\n integrationConfig: GiteaIntegrationConfig,\n options: {\n owner?: string;\n repo: string;\n defaultBranch: string;\n ctx: ActionContext<any, any, any>;\n },\n) {\n const startTimestamp = Date.now();\n\n const { owner, repo, defaultBranch, ctx } = options;\n const sleep = (ms: number | undefined) => new Promise(r => setTimeout(r, ms));\n let response: Response;\n\n while (Date.now() - startTimestamp < maxDuration) {\n if (ctx.signal?.aborted) return;\n\n response = await checkGiteaContentUrl(integrationConfig, {\n owner,\n repo,\n defaultBranch,\n });\n\n if (response.status !== 200) {\n // Repository is not yet available/accessible ...\n await sleep(1000);\n } else {\n // Gitea repository exists !\n break;\n }\n }\n}\n\n/**\n * Creates a new action that initializes a git repository using the content of the workspace.\n * and publishes it to a Gitea instance.\n * @public\n */\nexport function createPublishGiteaAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction({\n id: 'publish:gitea',\n description:\n 'Initializes a git repository using the content of the workspace, and publishes it to Gitea.',\n examples,\n schema: {\n input: {\n repoUrl: z =>\n z.string({\n description: 'Repository Location',\n }),\n description: z =>\n z.string({\n description: 'Repository Description',\n }),\n defaultBranch: z =>\n z\n .string({\n description: `Sets the default branch on the repository. The default value is 'main'`,\n })\n .optional(),\n repoVisibility: z =>\n z\n .enum(['private', 'public'], {\n description: `Sets the visibility of the repository. The default value is 'public'.`,\n })\n .optional(),\n gitCommitMessage: z =>\n z\n .string({\n description: `Sets the commit message on the repository. The default value is 'initial commit'`,\n })\n .optional(),\n gitAuthorName: z =>\n z\n .string({\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n })\n .optional(),\n gitAuthorEmail: z =>\n z\n .string({\n description: `Sets the default author email for the commit.`,\n })\n .optional(),\n sourcePath: z =>\n z\n .string({\n description: `Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.`,\n })\n .optional(),\n signCommit: z =>\n z\n .boolean({\n description: 'Sign commit with configured PGP private key',\n })\n .optional(),\n },\n output: {\n remoteUrl: z =>\n z\n .string({\n description: 'A URL to the repository with the provider',\n })\n .optional(),\n repoContentsUrl: z =>\n z\n .string({\n description: 'A URL to the root of the repository',\n })\n .optional(),\n commitHash: z =>\n z\n .string({\n description: 'The git commit hash of the initial commit',\n })\n .optional(),\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n description,\n defaultBranch = 'main',\n repoVisibility = 'public',\n gitAuthorName,\n gitAuthorEmail,\n gitCommitMessage = 'initial commit',\n sourcePath,\n signCommit,\n } = ctx.input;\n\n const { repo, host, owner } = parseRepoUrl(repoUrl, integrations);\n\n const integrationConfig = integrations.gitea.byHost(host);\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n const { username, password } = integrationConfig.config;\n\n if (!username || !password) {\n throw new Error('Credentials for the gitea ${host} required.');\n }\n\n // check if the org exists within the gitea server\n if (owner) {\n await checkGiteaOrg(integrationConfig.config, { owner });\n }\n\n await createGiteaProject(integrationConfig.config, {\n description,\n repoVisibility,\n owner: owner,\n projectName: repo,\n });\n\n const auth = {\n username: username,\n password: password,\n };\n const gitAuthorInfo = {\n name: gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n const signingKey =\n integrationConfig.config.commitSigningKey ??\n config.getOptionalString('scaffolder.defaultCommitSigningKey');\n if (signCommit && !signingKey) {\n throw new Error(\n 'Signing commits is enabled but no signing key is provided in the configuration',\n );\n }\n\n // The owner to be used should be either the org name or user authenticated with the gitea server\n const remoteUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}.git`;\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: generateCommitMessage(config, gitCommitMessage),\n gitAuthorInfo,\n });\n\n // Check if the gitea repo URL is available before to exit\n const maxDuration = 20000; // 20 seconds\n await checkAvailabilityGiteaRepository(\n maxDuration,\n integrationConfig.config,\n {\n owner,\n repo,\n defaultBranch,\n ctx,\n },\n );\n\n const repoContentsUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}/src/branch/${defaultBranch}/`;\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n"],"names":["getGiteaRequestOptions","crypto","createTemplateAction","examples","parseRepoUrl","InputError","initRepoAndPush","getRepoSourceDirectory"],"mappings":";;;;;;;;;;;;AAiCA,MAAM,oBAAA,GAAuB,OAC3B,MAAA,EACA,OAAA,KAKsB;AACtB,EAAA,MAAM,EAAE,KAAA,EAAO,IAAA,EAAM,aAAA,EAAc,GAAI,OAAA;AACvC,EAAA,IAAI,QAAA;AACJ,EAAA,MAAM,UAAA,GAA0B;AAAA,IAC9B,MAAA,EAAQ;AAAA,GACV;AAEA,EAAA,IAAI;AACF,IAAA,QAAA,GAAW,MAAM,KAAA;AAAA,MACf,CAAA,EAAG,OAAO,OAAO,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,IAAI,eAAe,aAAa,CAAA,CAAA;AAAA,MAC9D;AAAA,KACF;AAAA,EACF,SAAS,CAAA,EAAG;AACV,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,8BAAA,EAAiC,KAAK,CAAA,CAAA,EAAI,IAAI,eAAe,CAAC,CAAA;AAAA,KAChE;AAAA,EACF;AACA,EAAA,OAAO,QAAA;AACT,CAAA;AAEA,MAAM,aAAA,GAAgB,OACp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../../src/actions/gitea.examples.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description:\n 'Initializes a git repository with the content in the workspace, and publishes it to Gitea with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gitea repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n description: 'Initialize a gitea repository',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a private Gitea repository ',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n defaultBranch: 'main',\n repoVisibility: 'private',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gitea repository with a default Branch, if not set defaults to main',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n defaultBranch: 'staging',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gitea repository with an initial commit message, if not set defaults to `initial commit`',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n gitCommitMessage: 'Initial Commit Message',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gitea repository with a repo Author Name, if not set defaults to Scaffolder',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n gitAuthorName: 'John Doe',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gitea repository with a repo Author Email',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n gitAuthorEmail: 'johndoe@email.com',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n sourcePath: 'repository/',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gitea repository with all properties being set',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n description: 'Initialize a gitea repository',\n defaultBranch: 'staging',\n gitCommitMessage: 'Initial Commit Message',\n gitAuthorName: 'John Doe',\n gitAuthorEmail: 'johndoe@email.com',\n sourcePath: 'repository/',\n repoVisibility: 'public',\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAmBO,MAAM,
|
|
1
|
+
{"version":3,"file":"gitea.examples.cjs.js","sources":["../../src/actions/gitea.examples.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description:\n 'Initializes a git repository with the content in the workspace, and publishes it to Gitea with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gitea repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n description: 'Initialize a gitea repository',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a private Gitea repository ',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n defaultBranch: 'main',\n repoVisibility: 'private',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gitea repository with a default Branch, if not set defaults to main',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n defaultBranch: 'staging',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gitea repository with an initial commit message, if not set defaults to `initial commit`',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n gitCommitMessage: 'Initial Commit Message',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gitea repository with a repo Author Name, if not set defaults to Scaffolder',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n gitAuthorName: 'John Doe',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gitea repository with a repo Author Email',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n gitAuthorEmail: 'johndoe@email.com',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n sourcePath: 'repository/',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gitea repository with all properties being set',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitea',\n name: 'Publish to Gitea',\n input: {\n repoUrl: 'gitea.com?repo=repo&owner=owner',\n description: 'Initialize a gitea repository',\n defaultBranch: 'staging',\n gitCommitMessage: 'Initial Commit Message',\n gitAuthorName: 'John Doe',\n gitAuthorEmail: 'johndoe@email.com',\n sourcePath: 'repository/',\n repoVisibility: 'public',\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAmBO,MAAM,QAAA,GAA8B;AAAA,EACzC;AAAA,IACE,WAAA,EACE,2HAAA;AAAA,IACF,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,EAAA,EAAI,SAAA;AAAA,UACJ,MAAA,EAAQ,eAAA;AAAA,UACR,IAAA,EAAM,kBAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAA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A,UACJ,MAAA,EAAQ,eAAA;AAAA,UACR,IAAA,EAAM,kBAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,iCAAA;AAAA,YACT,WAAA,EAAa,+BAAA;AAAA,YACb,aAAA,EAAe,SAAA;AAAA,YACf,gBAAA,EAAkB,wBAAA;AAAA,YAClB,aAAA,EAAe,UAAA;AAAA,YACf,cAAA,EAAgB,mBAAA;AAAA,YAChB,UAAA,EAAY,aAAA;AAAA,YACZ,cAAA,EAAgB;AAAA;AAClB;AACF;AACF,KACD;AAAA;AAEL;;;;"}
|
package/dist/module.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport {\n createBackendModule,\n coreServices,\n} from '@backstage/backend-plugin-api';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport { createPublishGiteaAction } from './actions';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * @public\n * The Gitea Module for the Scaffolder Backend\n */\nexport const giteaModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'gitea',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, config }) {\n const integrations = ScmIntegrations.fromConfig(config);\n scaffolder.addActions(\n createPublishGiteaAction({\n integrations,\n config,\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations","createPublishGiteaAction"],"mappings":";;;;;;;AA2BO,MAAM,cAAcA,
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport {\n createBackendModule,\n coreServices,\n} from '@backstage/backend-plugin-api';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport { createPublishGiteaAction } from './actions';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * @public\n * The Gitea Module for the Scaffolder Backend\n */\nexport const giteaModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'gitea',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, config }) {\n const integrations = ScmIntegrations.fromConfig(config);\n scaffolder.addActions(\n createPublishGiteaAction({\n integrations,\n config,\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations","createPublishGiteaAction"],"mappings":";;;;;;;AA2BO,MAAM,cAAcA,oCAAA,CAAoB;AAAA,EAC7C,QAAA,EAAU,YAAA;AAAA,EACV,QAAA,EAAU,OAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAa,EAAG;AACzB,IAAA,YAAA,CAAa;AAAA,MACX,IAAA,EAAM;AAAA,QACJ,UAAA,EAAYC,qCAAA;AAAA,QACZ,QAAQC,6BAAA,CAAa;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,UAAA,EAAY,QAAO,EAAG;AACjC,QAAA,MAAM,YAAA,GAAeC,2BAAA,CAAgB,UAAA,CAAW,MAAM,CAAA;AACtD,QAAA,UAAA,CAAW,UAAA;AAAA,UACTC,8BAAA,CAAyB;AAAA,YACvB,YAAA;AAAA,YACA;AAAA,WACD;AAAA,SACH;AAAA,MACF;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend-module-gitea",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "The gitea module for @backstage/plugin-scaffolder-backend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
"test": "backstage-cli package test"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@backstage/backend-plugin-api": "^1.4.
|
|
53
|
+
"@backstage/backend-plugin-api": "^1.4.2",
|
|
54
54
|
"@backstage/config": "^1.3.3",
|
|
55
55
|
"@backstage/errors": "^1.2.7",
|
|
56
56
|
"@backstage/integration": "^1.17.1",
|
|
57
|
-
"@backstage/plugin-scaffolder-node": "^0.
|
|
57
|
+
"@backstage/plugin-scaffolder-node": "^0.11.0",
|
|
58
58
|
"yaml": "^2.0.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@backstage/backend-test-utils": "^1.
|
|
62
|
-
"@backstage/cli": "^0.
|
|
63
|
-
"@backstage/plugin-scaffolder-node-test-utils": "^0.3.
|
|
61
|
+
"@backstage/backend-test-utils": "^1.8.0",
|
|
62
|
+
"@backstage/cli": "^0.34.0",
|
|
63
|
+
"@backstage/plugin-scaffolder-node-test-utils": "^0.3.2",
|
|
64
64
|
"msw": "^1.0.0"
|
|
65
65
|
}
|
|
66
66
|
}
|