Files
backstage/plugins/circleci
github-actions[bot] c5584b62c2 Version Packages
2021-01-21 13:13:05 +00:00
..
2021-01-21 13:13:05 +00:00
2021-01-21 13:13:05 +00:00

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:
        $env: 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