GoCD logo

Backstage GoCD Plugin

Created by SoundCloud

GoCD is an open source continuous delivery server from ThoughtWorks. It helps teams model pipelines, automate build test deploy steps, and release with confidence. Many use it to keep delivery work flowing across repos and environments. If you already run GoCD, you know its strengths with pipelines and auditability. It fits well in regulated or self hosted setups where control matters.

The GoCD plugin for Backstage brings that delivery view into your developer portal. It adds a simple way to see recent pipeline runs for a service, with status and timing at a glance. You can jump from a service page to the matching pipeline in GoCD for deeper logs. The plugin surfaces delivery insights such as trends across builds, which helps you spot failures, aging branches, or slow stages before they spread. It cuts context switching so you stay in Backstage while checking release health.

Common use cases include triaging red builds during an incident, tracking release readiness before a cut, or giving product teams a clear view of what shipped. Platform teams can compare delivery signals across many services, then link out to GoCD when they need details. If Backstage is your home for docs and ownership, this plugin makes it your window into CI CD too.

Installation Instructions

These instructions apply to self-hosted Backstage only.

Install the frontend package

Run this in the repo root

Copy
yarn add --cwd packages/app @backstage-community/plugin-gocd

Add the GoCD tab to the entity page

Edit packages/app/src/components/catalog/EntityPage.tsx

Add the imports

Copy
import React from 'react';
import { EntityLayout } from '@backstage/plugin-catalog';
import { EntityGoCdContent, isGoCdAvailable } from '@backstage-community/plugin-gocd';

Add a tab for GoCD. You can keep it always visible

Copy
const componentEntityPage = (
  <EntityLayout>
    <EntityLayout.Route path="/go-cd" title="GoCD">
      <EntityGoCdContent />
    </EntityLayout.Route>
  </EntityLayout>
);

Or make it conditional based on the annotation

Copy
const componentEntityPage = (
  <EntityLayout>
    {isGoCdAvailable(entity) ? (
      <EntityLayout.Route path="/go-cd" title="GoCD">
        <EntityGoCdContent />
      </EntityLayout.Route>
    ) : null}
  </EntityLayout>
);

You do not need to register any extra routes in App.tsx. The tab sits on the entity page.

Configure the proxy and base URL

Add this to app-config.yaml or app-config.local.yaml

Copy
proxy:
  '/gocd':
    target: '<go cd server host>/go/api'
    allowedMethods: ['GET']
    allowedHeaders: ['Authorization']
    headers:
      Authorization: Basic ${GOCD_AUTH_CREDENTIALS}

gocd:
  baseUrl: <go cd server host>

Set GOCD_AUTH_CREDENTIALS in your environment. The value is base64 of user colon pass. Example root colon root becomes cm9vdDpyb290

Enable the proxy in a new backend system

If your backend uses the new backend system with createBackend

Install the proxy backend plugin

Copy
yarn add --cwd packages/backend @backstage/plugin-proxy-backend

Wire it in packages/backend/src/index.ts

Copy
import { createBackend } from '@backstage/backend-defaults';

const backend = createBackend();

// Enable the proxy backend
backend.add(import('@backstage/plugin-proxy-backend'));

backend.start();

Nothing else is required for the proxy routes that use the proxy section in app config

Enable the proxy in a legacy backend

If your backend uses the legacy express app setup

Install the proxy backend plugin

Copy
yarn add --cwd packages/backend @backstage/plugin-proxy-backend

Create or update packages/backend/src/plugins/proxy.ts

Copy
import { PluginEnvironment } from '../types';
import { createRouter } from '@backstage/plugin-proxy-backend';

export default async function createPlugin(env: PluginEnvironment) {
  return await createRouter({
    logger: env.logger,
    config: env.config,
    discovery: env.discovery,
    tokenManager: env.tokenManager,
  });
}

Add it to packages/backend/src/index.ts

Copy
import proxy from './plugins/proxy';

// inside main where app and router are created
const proxyRouter = await proxy(env);
app.use('/proxy', proxyRouter);

The proxy reads the proxy section from app config

Add the entity annotation

Add the pipelines annotation to the catalog info for each component that should show the GoCD tab. Use one or more pipeline names separated by commas

Copy
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: example
  annotations:
    gocd.org/pipelines: 'pipeline-one,pipeline-two'
spec:
  type: service
  owner: team-a
  lifecycle: production

Optional exports you can use

The package also exports these items

Copy
import {
  gocdPlugin,
  GOCD_PIPELINES_ANNOTATION,
  isGoCdAvailable,
  EntityGoCdContent,
} from '@backstage-community/plugin-gocd';

You can use GOCD_PIPELINES_ANNOTATION for consistency in custom code. isGoCdAvailable helps hide the tab when the annotation is missing

Changelog

This changelog is produced from commits made to the GoCD plugin since a year ago, and based on the code located here. It may not contain information about all commits. Releases and version bumps are intentionally omitted. This changelog is generated by AI.

Maintenance

  • Remove unused dev dependency canvas. Patch release to v0.5.0. #3565 merged 6 months ago
  • Reduce false positives in knip reports. Use a workspace based config. No change to runtime behavior. No release change. #3018 merged 7 months ago

Breaking changes

None

Set up Backstage in minutes with Roadie