backstage

Форк
0
72 строки · 2.0 Кб
1
/*
2
 * Copyright 2020 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
 */
16
import { cloudbuildApiRef, CloudbuildClient } from './api';
17
import { rootRouteRef } from './routes';
18
import {
19
  createPlugin,
20
  createApiFactory,
21
  googleAuthApiRef,
22
  createRoutableExtension,
23
  createComponentExtension,
24
} from '@backstage/core-plugin-api';
25

26
/** @public */
27
export const cloudbuildPlugin = createPlugin({
28
  id: 'cloudbuild',
29
  apis: [
30
    createApiFactory({
31
      api: cloudbuildApiRef,
32
      deps: { googleAuthApi: googleAuthApiRef },
33
      factory({ googleAuthApi }) {
34
        return new CloudbuildClient(googleAuthApi);
35
      },
36
    }),
37
  ],
38
  routes: {
39
    entityContent: rootRouteRef,
40
  },
41
});
42

43
/** @public */
44
export const EntityCloudbuildContent = cloudbuildPlugin.provide(
45
  createRoutableExtension({
46
    name: 'EntityCloudbuildContent',
47
    component: () => import('./components/Router').then(m => m.Router),
48
    mountPoint: rootRouteRef,
49
  }),
50
);
51

52
/** @public */
53
export const EntityLatestCloudbuildRunCard = cloudbuildPlugin.provide(
54
  createComponentExtension({
55
    name: 'EntityLatestCloudbuildRunCard',
56
    component: {
57
      lazy: () =>
58
        import('./components/Cards').then(m => m.LatestWorkflowRunCard),
59
    },
60
  }),
61
);
62

63
/** @public */
64
export const EntityLatestCloudbuildsForBranchCard = cloudbuildPlugin.provide(
65
  createComponentExtension({
66
    name: 'EntityLatestCloudbuildsForBranchCard',
67
    component: {
68
      lazy: () =>
69
        import('./components/Cards').then(m => m.LatestWorkflowsForBranchCard),
70
    },
71
  }),
72
);
73

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.