backstage
README.md
CircleCI Plugin
[!IMPORTANT] This plugin is now developed & maintained by CircleCI. Please refer to their up-to-date documentation & plugin repository for help.
Screenshots
Setup
- If you have a standalone app (you didn't clone this repo), then do
# From your Backstage root directoryyarn --cwd packages/app add @circleci/backstage-plugin
- Add the
EntityCircleCIContent
extension to the entity page in your app:
// In packages/app/src/components/catalog/EntityPage.tsximport { EntityCircleCIContent, isCircleCIAvailable,} from '@circleci/backstage-plugin';
// For example in the CI/CD sectionconst cicdContent = ( <EntitySwitch> <EntitySwitch.Case if={isCircleCIAvailable}> <EntityCircleCIContent /> </EntitySwitch.Case>
- Add proxy config:
# In app-config.yamlproxy: '/circleci/api': target: https://circleci.com/api/v1.1 headers: Circle-Token: ${CIRCLECI_AUTH_TOKEN}
- Get and provide a
CIRCLECI_AUTH_TOKEN
as an environment variable (see the CircleCI docs). - Add an annotation to your respective
catalog-info.yaml
files, with the formatcircleci.com/project-slug: <git-provider>/<owner>/<project>
(See reference in ADR002).
# Example catalog-info.yaml entity definition fileapiVersion: backstage.io/v1alpha1kind: Componentmetadata: # ... annotations: # This also supports bitbucket/xxx/yyy circleci.com/project-slug: github/my-org/my-repospec: 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
- CircleCI has pretty strict rate limits per token, be careful with opened tabs
- CircleCI doesn't provide a way to auth by 3rd party (e.g. GitHub) token, nor by calling their OAuth endpoints, which currently stands in the way of better auth integration with Backstage (reference feature request and discussion topic)