Files
backstage/plugins/circleci/README.md
T
Fredrik Adelöw c28689c686 change all $env to ${}
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-15 13:26:44 +02:00

1.9 KiB

CircleCI Plugin

Website: https://circleci.com/

Setup

  1. If you have standalone app (you didn't clone this repo), then do
yarn add @backstage/plugin-circleci
  1. Add plugin itself:
// packages/app/src/plugins.ts
export { plugin as Circleci } from '@backstage/plugin-circleci';
  1. Register the plugin router:
// packages/app/src/components/catalog/EntityPage.tsx

import { Router as CircleCIRouter } from '@backstage/plugin-circleci';

// Then somewhere inside <EntityPageLayout>
<EntityPageLayout.Content
  path="/ci-cd/*"
  title="CI/CD"
  element={<CircleCIRouter />}
/>;
  1. Add proxy config:
// app-config.yaml
proxy:
  '/circleci/api':
    target: https://circleci.com/api/v1.1
    headers:
      Circle-Token: ${CIRCLECI_AUTH_TOKEN}
  1. Get and provide CIRCLECI_AUTH_TOKEN as env variable (https://circleci.com/docs/api/#add-an-api-token)
  2. Add circleci.com/project-slug annotation to your catalog-info.yaml file in format // (https://backstage.io/docs/architecture-decisions/adrs-adr002#format)
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  # ...
  annotations:
    # This also supports bitbucket/xxx/yyy
    circleci.com/project-slug: github/my-org/my-repo
spec:
  type: service
  # ...

Features

  • List top 50 builds for a project
  • Dive into one build to see logs
  • Polling (logs only)
  • Retry builds
  • Works for both project and personal tokens
  • Pagination for builds

Limitations