backstage

Форк
0
55 строк · 1.8 Кб
1
/*
2
 * Copyright 2021 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 React from 'react';
17
import { createDevApp } from '@backstage/dev-utils';
18
import { EntityAllureReportContent } from '../src/plugin';
19
import { Content, Header, Page } from '@backstage/core-components';
20
import { EntityProvider } from '@backstage/plugin-catalog-react';
21
import { Entity } from '@backstage/catalog-model';
22

23
import exampleEntity from './example-entity.yaml';
24
import { allureApiRef } from '../src/api';
25

26
createDevApp()
27
  .registerApi({
28
    api: allureApiRef,
29
    deps: {},
30
    factory: () =>
31
      ({
32
        async getReportUrl(projectId: string) {
33
          return Promise.resolve(
34
            // Follow the instructions from https://github.com/fescobar/allure-docker-service-ui
35
            // to setup Allure service locally
36
            `http://localhost:5050/allure-docker-service/projects/${projectId}/reports/latest/index.html`,
37
          );
38
        },
39
      } as unknown as typeof allureApiRef.T),
40
  })
41
  .addPage({
42
    element: (
43
      <Page themeId="home">
44
        <Header title="Allure Report" />
45
        <Content>
46
          <EntityProvider entity={exampleEntity as any as Entity}>
47
            <EntityAllureReportContent />
48
          </EntityProvider>
49
        </Content>
50
      </Page>
51
    ),
52
    title: 'Allure Report',
53
    path: '/allure',
54
  })
55
  .render();
56

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

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

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

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