Files
backstage/plugins/circleci
github-actions[bot] b04011602b Version Packages
2022-01-13 14:23:13 +00:00
..
2021-12-30 12:53:16 +01:00
2021-11-17 20:26:01 +01:00
2022-01-13 14:23:13 +00:00
2022-01-13 14:23:13 +00:00

CircleCI Plugin

Website: https://circleci.com/

Setup

  1. If you have a standalone app (you didn't clone this repo), then do
# From your Backstage root directory
cd packages/app
yarn add @backstage/plugin-circleci
  1. Add the EntityCircleCIContent extension to the entity page in your app:
// In packages/app/src/components/catalog/EntityPage.tsx
import {
  EntityCircleCIContent,
  isCircleCIAvailable,
} from '@backstage/plugin-circleci';

// For example in the CI/CD section
const cicdContent = (
  <EntitySwitch>
    <EntitySwitch.Case if={isCircleCIAvailable}>
      <EntityCircleCIContent />
    </EntitySwitch.Case>
  1. Add proxy config:
# In app-config.yaml
proxy:
  '/circleci/api':
    target: https://circleci.com/api/v1.1
    headers:
      Circle-Token: ${CIRCLECI_AUTH_TOKEN}
  1. Get and provide a CIRCLECI_AUTH_TOKEN as an environment variable (see the CircleCI docs).
  2. Add a circleci.com/project-slug annotation to your respective catalog-info.yaml files, on the format // (https://backstage.io/docs/architecture-decisions/adrs-adr002#format).
# Example catalog-info.yaml entity definition file
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