Files
backstage/plugins/circleci
blam f326c2ee1e Merge branch 'master' of github.com:spotify/backstage into feat/backend-plugin
* 'master' of github.com:spotify/backstage: (30 commits)
  fix(techdocs-core): use the content of the readme as long description for the pypi package (#2578)
  chore: add contrib to CONTRIBUTING.md (#2585)
  Fix typo (#2584)
  backend-common: default config env to development
  v0.1.1-alpha.23
  TechDocs: Inject CSS transformer and initial backstage style integration for reader (#2560)
  bug(gql): use import to import the graphql module
  Rename file
  [blog] Announce CNCF Sandbox (#2568)
  document cleaning - tutorial quickstarts (#2520)
  Simplify codecov flag names
  chore(scaffolder-backend): typo in visibility
  Kubernetes plugins boilerplate (#2559)
  CHANGELOG: add entry for SessionApi refactor
  Upload package specific code coverage to codecov
  Add codecov flags for core and core-api packages
  TechDocs: Enable allowVulnerableTags in sanitize-html (#2554)
  chore: trust the Boolean :)
  docs: regenerate api reference docs
  core: refactor SessionStateApi to SessionApi with sign-in/out
  ...
2020-09-24 10:54:04 +02:00
..
2020-09-22 11:49:45 +02:00
2020-05-18 14:14:03 +02: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 API to your Backstage instance:
// packages/app/src/api.ts
import { ApiHolder } from '@backstage/core';
import { CircleCIApi, circleCIApiRef } from '@backstage/plugin-circleci';

const builder = ApiRegistry.builder();
builder.add(circleCIApiRef, new CircleCIApi(/* optional custom url for your own CircleCI instance */));

export default builder.build() as ApiHolder;
  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
    changeOrigin: true
    pathRewrite:
      '^/proxy/circleci/api/': '/'
    headers:
      Circle-Token:
        $secret:
          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 component-info.yaml file in format // (https://backstage.io/docs/architecture-decisions/adrs-adr002#format)

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