From 6c7f00eb02a537d1c7582728e81b612b66a159a3 Mon Sep 17 00:00:00 2001 From: Andrew Shirley Date: Thu, 17 Jun 2021 19:44:29 +0100 Subject: [PATCH] Add changesets Signed-off-by: Andrew Shirley Signed-off-by: blam --- .changeset/good-hornets-hunt.md | 65 +++++++++++++++++++++++++++++++++ .changeset/light-frogs-prove.md | 9 +++++ 2 files changed, 74 insertions(+) create mode 100644 .changeset/good-hornets-hunt.md create mode 100644 .changeset/light-frogs-prove.md diff --git a/.changeset/good-hornets-hunt.md b/.changeset/good-hornets-hunt.md new file mode 100644 index 0000000000..847acda1ab --- /dev/null +++ b/.changeset/good-hornets-hunt.md @@ -0,0 +1,65 @@ +--- +'@backstage/plugin-jenkins': major +--- + +## Extract an entity-oriented Jenkins Backend + +Change the Jenkins plugin from talking directly with a single jenkins instance (via the proxy) to having a specific +backend plugin which talks to the jenkins instances. + +Existing users of the Jenkins plugin will need to configure a jenkins backend instead of a proxy. +Typically, this means creating a `src/plugins/jenkins.ts` file, adding a reference to it to `src/index.ts` and changing app-config.yaml + +### jenkins.ts + +```typescript +import { + createRouter, + DefaultJenkinsInfoProvider, +} from '@backstage/plugin-jenkins-backend'; +import { CatalogClient } from '@backstage/catalog-client'; +import { Router } from 'express'; +import { PluginEnvironment } from '../types'; + +export default async function createPlugin({ + logger, + config, + discovery, +}: PluginEnvironment): Promise { + const catalogClient = new CatalogClient({ discoveryApi: discovery }); + + return await createRouter({ + logger, + jenkinsInfoProvider: new DefaultJenkinsInfoProvider(catalogClient, config), + }); +} +``` + +### app-config.yaml + +For example + +```yaml +proxy: + '/jenkins/api': + target: 'https://jenkins.example.com:8080' # your Jenkins URL + changeOrigin: true + headers: + Authorization: Basic ${JENKINS_BASIC_AUTH_HEADER} +``` + +Would become: + +```yaml +jenkins: + baseUrl: https://jenkins.example.com:8080 + username: backstage-bot + apiKey: ${JENKINS_PASSWORD} +``` + +## Change BuildWithStepsPage route + +The plugin originally provided a route to view a particular build of a particular branch so that if you wanted to view +the master branch of an entity annotated with `'jenkins.io/github-folder': teamA/artistLookup-build` you could typically +access `/catalog/default/component/artist-lookup/ci-cd/run/master/7` but would now have to access +`/catalog/default/component/artist-lookup/ci-cd/build/teamA%2FartistLookup-build%2Fmaster/7` diff --git a/.changeset/light-frogs-prove.md b/.changeset/light-frogs-prove.md new file mode 100644 index 0000000000..09c2839853 --- /dev/null +++ b/.changeset/light-frogs-prove.md @@ -0,0 +1,9 @@ +--- +'example-backend': patch +'@backstage/plugin-jenkins-backend': patch +--- + +## Extract an entity-oriented Jenkins Backend + +Change the Jenkins plugin from talking directly with a single jenkins instance (via the proxy) to having a specific +backend plugin which talks to the jenkins instances.