VeeCode Gitlab Pipelines brings GitLab CI into Backstage. It adds a simple view of recent pipelines for each service, with status, links, and run time. You can pick a branch, start a new pipeline, or cancel one without leaving the service page. It keeps your build signals close to the code and docs your team already uses.
The plugin supports two main flows. You can run or cancel a fresh pipeline and see the latest results. You can also trigger specific jobs or job groups by passing variables. That helps when you need to deploy, restart, or run a one off task without kicking off a full workflow. Each action creates a new pipeline so the run uses the latest version of your code and config.
This is useful if your teams work in GitLab and track services in Backstage. It cuts context switching during releases, hotfixes, and routine ops. It is a fit for platform teams that want a clean way to expose safe pipeline actions to service owners. It works with GitLab in the cloud and with self hosted instances, so you can use it in most environments your company runs today.
Installation Instructions
These instructions apply to self-hosted Backstage only.
Install the frontend package
- Add the plugin to the app package with yarn 3.x
yarn workspace app add @veecode-platform/backstage-plugin-gitlab-pipelines
- Or add it with other yarn versions
yarn add --cwd packages/app @veecode-platform/backstage-plugin-gitlab-pipelines
Configure GitLab integration and auth
- Configure a GitLab integration in your Backstage app config.
- Configure a GitLab auth provider in your Backstage backend.
- If your GitLab is self hosted, set apiBaseUrl in the GitLab integration entry in app config. This is required.
Add the proxy config
- Add a proxy entry in app config
# app-config.yaml proxy: endpoints: '/gitlab/api': target: https://gitlab.com/api/v4 credentials: dangerously-allow-unauthenticated allowedHeaders: ['Authorization', 'Content-Type'] headers: Accept: application/json Content-Type: application/json
- If your GitLab is self hosted, change target to your instance api v4 url. Keep the same headers list.
Prepare your .gitlab_ci.yml
- Use variables to control default jobs and specific jobs.
- Example config
stages: - build - deploy - start - stop variables: DEFAULT_JOB: 'false' START_JOB: 'false' STOP_JOB: 'false' build-job: stage: build script: - echo "Compiling the code..." - echo "Compile complete." rules: - if: $DEFAULT_JOB == "true" deploy-job: stage: deploy environment: production script: - echo "Deploying application..." - echo "Application successfully deployed." rules: - if: $DEFAULT_JOB == "true" start-job: stage: start script: - echo "start job..." rules: - if: $START_JOB == "true" stop-job: stage: stop script: - echo "stop job..." rules: - if: $STOP_JOB == "true"
- Use DEFAULT_JOB for your standard pipeline flow. Use one variable per specific job for ad hoc runs.
Add entity annotations
- Add the GitLab project slug to your catalog entity.
# catalog-info.yaml apiVersion: backstage.io/v1alpha1 kind: Component metadata: name: Test description: gitlab test annotations: gitlab.com/project-slug: repo/test backstage.io/techdocs-ref: dir:. spec: type: service lifecycle: experimental owner: admin
- Optional simple jobs annotation
metadata: annotations: gitlab.com/project-slug: repo/test gitlab.com/jobs: 'Deploy:DEFAULT_JOB,Start:START_JOB,Stop:STOP_JOB'
- Optional custom jobs annotation with labels and tooltips
metadata: annotations: gitlab.com/project-slug: repo/test gitlab.com/jobs: | [ { "label": "Deploy", "var": "DEPLOY_JOB", "tooltip": "Deploy application" }, { "label": "Start", "var": "START_JOB", "tooltip": "Start the instance" }, { "label": "Stop", "var": "STOP_JOB", "tooltip": "Stop the instance" } ]
Add the UI components to EntityPage
- Open this file
packages/app/src/components/catalog/EntityPage.tsx
- Import the plugin parts
// packages/app/src/components/catalog/EntityPage.tsx import React from 'react'; import { Grid } from '@material-ui/core'; import { EntitySwitch } from '@backstage/plugin-catalog'; import { EntityAboutCard, EntityCatalogGraphCard, EntityLinksCard } from '@backstage/plugin-catalog'; import { GitlabPipelineList, isGitlabAvailable, GitlabJobs, isGitlabJobsAvailable, } from '@veecode-platform/backstage-plugin-gitlab-pipelines';
- Show the pipelines list in your CI content section
const cicdContent = ( <EntitySwitch> <EntitySwitch.Case if={isGitlabAvailable}> <GitlabPipelineList /> </EntitySwitch.Case> </EntitySwitch> );
- Show the jobs card in your overview section
const overviewContent = ( <Grid container spacing={3} alignItems="stretch"> <Grid item md={6}> <EntityAboutCard variant="gridItem" /> </Grid> <Grid item md={6} xs={12}> <EntityCatalogGraphCard variant="gridItem" height={400} /> </Grid> <EntitySwitch> <EntitySwitch.Case if={isGitlabJobsAvailable}> <Grid item lg={8} xs={12}> <GitlabJobs /> </Grid> </EntitySwitch.Case> </EntitySwitch> <Grid item md={4} xs={12}> <EntityLinksCard /> </Grid> </Grid> );
Backend setup for the proxy
The plugin itself does not ship a backend package. It calls the GitLab API through the Backstage proxy. Make sure the proxy backend is running.
Legacy backend system
- Add the proxy backend if missing
yarn workspace backend add @backstage/plugin-proxy-backend
- Create a proxy plugin file if your app does not have one
// packages/backend/src/plugins/proxy.ts import { createRouter } from '@backstage/plugin-proxy-backend'; import { PluginEnvironment } from '../types'; export default async function createPlugin(env: PluginEnvironment) { return await createRouter({ logger: env.logger, config: env.config, discovery: env.discovery, tokenManager: env.tokenManager, }); }
- Wire it in the backend index
// packages/backend/src/index.ts import proxy from './plugins/proxy'; async function main() { // existing env setup here const env = useHotMemoize(module, createEnv); const router = Router(); router.use('/proxy', await proxy(env)); // existing server start here } main().catch(err => { process.exit(1); });
New backend system
- Add the proxy backend module
yarn workspace backend add @backstage/plugin-proxy-backend
- Register it in the backend entry
// packages/backend/src/index.ts import { createBackend } from '@backstage/backend-defaults'; const backend = createBackend(); backend.add(import('@backstage/plugin-proxy-backend')); backend.start();
How it works at runtime
- The UI reads gitlab.com/project-slug from the entity.
- The UI talks to the Backstage proxy at the path set in app config.
- The proxy forwards requests to the GitLab API v4 target.
- The GitLab auth provider supplies the Authorization header through Backstage.
Changelog
This changelog is produced from commits made to the VeeCode Gitlab Pipelines 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.
Features
- Add alpha export 3 months ago
- Add shared icon components Error RadioButtonChecked CheckCircle ChevronRight HighlightOff AccessTime 3 months ago
Bug fixes
- Improve asset loading during builds with Yarn v4 changes 12 months ago
Refactor
- Replace react icons with shared icon components in StatusComponent 3 months ago
- Refactor code structure for readability and maintainability 3 months ago
- Small refactor 11 months ago
Dependencies
- Update Backstage from v1.32.4 to v1.35.0 8 months ago
- Update to Yarn v4 12 months ago
Set up Backstage in minutes with Roadie
Focus on using Backstage, rather than building and maintaining it.