Files
backstage/plugins/circleci
David Tuite b48d37c022 Fix CircleCI plugin (#1384)
* Fix disappearing CircleCI plugin

The paths for the CircleCI plugin were too deeply nested causing a blank
page to render when one visited /circleci.

* Set correct inputs from CircleCI settings

Typically, a value like `tokenFromStore` would be an empty string. The
code was setting `tokenFromStore` (rather than `token`) into the state
on every keystroke.

I don't know what potential effect this change has on storing tokens
because I haven't tested that feature yet. Hopefully it still works as
intended.

* Add Vim .swp files to .gitignore

Co-authored-by: David Tuite <dtuite@gmail.com>
2020-06-21 21:10:53 +02:00
..
2020-05-18 18:00:30 +02:00
2020-06-21 21:10:53 +02:00
2020-05-18 14:14:03 +02:00
2020-05-19 14:57:30 +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. Run app with yarn start and navigate to /circleci/settings
  2. Enter project settings and project token, acquired according to https://circleci.com/docs/2.0/managing-api-tokens/

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

  • CircleCI has pretty strict rate limits per token, be careful with opened tabs