Files
backstage/plugins/jenkins
blam 06f410cc93 Merge branch 'master' of github.com:spotify/backstage into migrate-to-msw
* 'master' of github.com:spotify/backstage: (34 commits)
  TechDocs Backend: Replace hardcoded github api by configuration value (#3004)
  fix: accordion details design for job stage failure  (#3014)
  fix: responsive of page example in storybook (#3005)
  fix: update the ItemCard component and it's story (#3007)
  rename stories folder to Chip (#3009)
  feat: Display the plugins InfoCards on EntityPage Overwiev suitable full height (#2826)
  fix(cost-insights): More exports to help custom alerting
  chore(scaffolder): bump rjsf
  remove unused CSS (#2999)
  feat: update github pull requests package version
  fix(github-actions): fix crash when viewing ongoing workflows
  fix(cli): removePlugin forgotten await
  catalog-backend: relations db review comments and more tests
  Feat/add aws lambda plugin (#2985)
  chore(deps): bump object-path from 0.11.4 to 0.11.5 (#2983)
  add changeset
  fix CodeSnippet test case warnings
  fix CopyTextButton test case warnings
  fix the warning by wrapping in act
  fix(catalog): fix link to techdocs
  ...
2020-10-21 11:27:18 +02:00
..
2020-08-12 12:54:06 +02:00
2020-08-12 12:54:06 +02:00
2020-10-21 10:36:36 +02:00

Jenkins Plugin (Alpha)

Website: https://jenkins.io/

Last master build Folder results Build details

Setup

  1. If you have a standalone app (you didn't clone this repo), then do
yarn add @backstage/plugin-jenkins
  1. Add plugin:
// packages/app/src/plugins.ts
export { plugin as Jenkins } from '@backstage/plugin-jenkins';
  1. Add proxy configuration to app-config.yaml
proxy:
  '/jenkins/api':
    target: 'http://localhost:8080' # your Jenkins URL
    changeOrigin: true
    headers:
      Authorization:
        $env: JENKINS_BASIC_AUTH_HEADER
  1. Add an environment variable which contains the Jenkins credentials, (note: use an API token not your password). Here user is the name of the user created in Jenkins.
HEADER=$(echo -n user:api-token | base64)
export JENKINS_BASIC_AUTH_HEADER="Basic $HEADER"
  1. Run app with yarn start
  2. Add the Jenkins folder annotation to your component-info.yaml, (note: currently this plugin only supports folders and Git SCM)
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: 'your-component'
  description: 'a description'
  annotations:
    jenkins.io/github-folder: 'folder-name/job-name'
spec:
  type: service
  lifecycle: experimental
  owner: your-name
  1. Register your component

  2. Click the component in the catalog you should now see Jenkins builds, and a last build result for your master build.

Note:

If you are not using environment variable then you can directly type API token in app-config.yaml

proxy:
  '/jenkins/api':
    target: 'http://localhost:8080' # your Jenkins URL
    changeOrigin: true
    headers:
      Authorization: Basic YWRtaW46MTFlYzI1NmU0Mzg1MDFjM2Y1Yzc2Yjc1MWE3ZTQ3YWY4Mw==

YWRtaW46MTFlYzI1NmU0Mzg1MDFjM2Y1Yzc2Yjc1MWE3ZTQ3YWY4Mw== is the base64 of user and it's API token e.g. admin:11ec256e438501c3f5c76b751a7e47af83

Features

  • View all runs inside a folder
  • Last build status for specified branch
  • View summary of a build

Limitations

  • Only works with projects that use the Git SCM
  • It requires jobs to be organised into folders
  • No pagination support currently - don't run this on a Jenkins with lots of builds