backstage
48 строк · 1.5 Кб
1/*
2* Copyright 2024 The Backstage Authors
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16import {17createBackendModule,18coreServices,19} from '@backstage/backend-plugin-api';20import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';21import { createPublishGiteaAction } from './actions';22import { ScmIntegrations } from '@backstage/integration';23
24/**
25* @public
26* The Gitea Module for the Scaffolder Backend
27*/
28export const giteaModule = createBackendModule({29pluginId: 'scaffolder',30moduleId: 'gitea',31register({ registerInit }) {32registerInit({33deps: {34scaffolder: scaffolderActionsExtensionPoint,35config: coreServices.rootConfig,36},37async init({ scaffolder, config }) {38const integrations = ScmIntegrations.fromConfig(config);39scaffolder.addActions(40createPublishGiteaAction({41integrations,42config,43}),44);45},46});47},48});49