@harnessio/backstage-plugin-ci-cd

中文文档
1.0.0发布于 2026/09/09Apache-2.0TypeScriptCommonJS近 30 天下载 5607

Harness CI/CD plugin for Backstage. 1.0.0 targets Backstage 1.53 / React 18. Use 0.11.x for older Backstage.

原始使用文档
文档目录8 节
  1. Version compatibility
  2. New frontend system (Backstage 1.53)
  3. Screenshots
  4. Getting started
  5. Setup steps
  6. Other configurations
  7. Features
  8. Upcoming features

Harness NextGen CI/CD plugin

Website: https://harness.io/

Welcome to the Harness NextGen CI/CD plugin for Backstage!

Version compatibility

Plugin versionBackstageReactNodeNotes
1.0.0 (this package)1.53.x1822 or 24Use this for hosts on Backstage 1.53 (e.g. new frontend system).
0.11.x~1.2116 / 1718 / 20Pin 0.11.0 if you are not on Backstage 1.50+. ^0.11.0 will not install 1.0.0.
# Backstage 1.53 / React 18
yarn add --cwd packages/app @harnessio/backstage-plugin-ci-cd@^1.0.0

# Older Backstage (keep existing installs)
yarn add --cwd packages/app @harnessio/[email protected]

Do not publish 1.53-only changes as 0.11.x or 0.12.x — ^0.11.0 would pull them into older apps.

New frontend system (Backstage 1.53)

Install the default plugin feature:

import harnessCiCdPlugin from '@harnessio/backstage-plugin-ci-cd/alpha';

and add it to your app's plugin list. The entity tab path defaults to /harness-ci-cd.

Legacy EntityPage.tsx wiring below still works on the old frontend system.

Screenshots

Getting started

We have video tutorial for the plugin.

Watch here

Setup steps

  1. Open terminal and navigate to the root of your Backstage app. Then run
yarn add --cwd packages/app @harnessio/backstage-plugin-ci-cd@^1.0.0

yarn install

If you are looking to get started with Backstage, check out backstage.io/docs.

For testing purposes, you can also clone this repository to try out the plugin. It contains an example Backstage app setup which is pre-installed with Harness plugins. However, you must create a new Backstage app if you are looking to get started with Backstage.

  1. Configure proxy for harness in your app-config.yaml under the proxy config. Add your Harness Personal Access Token or Service Account Token for x-api-key. See the Harness docs for generating an API Key.
# In app-config.yaml

proxy:
  # ... existing proxy settings
  '/harness/prod':
    target: 'https://app.harness.io/'
    headers:
      'x-api-key': '<YOUR PAT/SAT>'
# ...

Notes:

  • Plugin uses token configured here to make Harness API calls. Make sure the user creating this API token has necessary permissions, which include project view permission along with pipeline view and execute permissions and same applies for service accounts as well it must have a role assigned that has the roles with adequate permissions as described before.

  • Set the value of target to your on-prem URL if you are using the Harness on-prem offering

  1. Inside your Backstage's EntityPage.tsx, update the cicdContent component to render <EntityHarnessCiCdContent /> whenever the service is using Harness CI/CD. Something like this -
// In packages/app/src/components/catalog/EntityPage.tsx

import {
  isHarnessCiCdAvailable,
  EntityHarnessCiCdContent,
} from '@harnessio/backstage-plugin-ci-cd';

const cicdContent = (
  // ...
  <EntitySwitch.Case if={isHarnessCiCdAvailable}>
    <EntityHarnessCiCdContent />
  </EntitySwitch.Case>
  // ...
);

Note: If you have separate providers for CI and CD apart from Harness, you need to add a new tab for Harness CI/CD plugin like below instead of replacing your existing CI/CD tab mentioned above.

Instructions in case of separate CI and CD provider (Click to expand)
// In packages/app/src/components/catalog/EntityPage.tsx

import {
  isHarnessCiCdAvailable,
  EntityHarnessCiCdContent,
} from '@harnessio/backstage-plugin-ci-cd';

const serviceEntityPage = (
  // ...
  <EntityLayout.Route
    path="/harness-ci-cd"
    title="Harness CI/CD"
    if={isHarnessCiCdAvailable}
  >
    <EntityHarnessCiCdContent />
  </EntityLayout.Route>
  // ...
);
  1. Add required harness specific annotations to your software component's respective catalog-info.yaml file.

Here is an example: catalog-info-new.yaml

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  # ...
  annotations:
    # optional annotation
    harness.io/pipelines: |
      labelA: <harness_pipeline_url>
      labelB: <harness_pipeline_url>
    # here labelA / labelB denotes the value you will see in dropdown in execution list. Refer screentshot 1
    # optional annotation
    harness.io/services: |
      labelA: <harness_service_url>
      labelB: <harness_service_url>
spec:
  type: service
  # ...

Old Annotation

Here is an example: https://github.com/harness/backstage-plugins/blob/main/examples/catalog-harness-cicd.yaml

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  # ...
  annotations:
    # mandatory annotation
    harness.io/project-url: <harness_project_url>

    # optional annotations
    # harness.io/ci-pipelineIds: <pipelineId1,pipelineId2,pipelineId3 etc>
    # harness.io/cd-serviceId: <serviceId>
spec:
  type: service
  # ...

Note: If new annotation is present then old annotation will be ignored for that particular catalog.
Note: Refer to this page on how to get these values from your Harness account.

By default, the plugin will take all the pipelines inside the configured Harness project and show their executions. However, if your service has quiet a few pipelines, you can additionally configure the pipelines as well as associated services to show those specific execution details for the display.

Other configurations

  • (Optional) Harness URL

If you have a separate Harness hosted URL other than https://app.harness.io, you can configure baseUrl for harness in app-config.yaml This step is optional. The default value of harness.baseUrl is https://app.harness.io/

# In app-config.yaml

harness:
  baseUrl: https://app.harness.io/
  • Enable/Disable re-run pipelines feature

By default, Backstage users will be able to re-run pipelines from the plugin. However, if your Backstage app doesn't have a good RBAC policy, users can technically re-run pipelines for any service. Due to this, we have a way to disable the re-run pipeline feature. You can do this by configuring harness.disableRunPipeline.

# app-config.yaml

harness:
  # (Optional) Change it true to remove "Run Pipeline" option on the pipeline executions table
  disableRunPipeline: false

Features

  • Connect a Backstage service with a Harness project and view top 50 executions from the pipelines in the project.
  • See details about executions - status, execution timestamp and time taken, associated triggers for CI pipelines, services deployed for CD pipelines.
  • Specify pipeline IDs (CI) or service IDs (CD) to narrow down on pipeline executions to show in the Backstage service view.
  • Retry pipeline executions from the plugin

Upcoming features

Checkout the next milestone for the CI/CD plugin to learn about the planned features. If you have some ideas and want to give feedback, feel free to create a new GitHub issue and suggest a feature request.

版本与发布记录

@harnessio/backstage-plugin-ci-cd 共发布 22 个版本,首次发布于 2022/11/11;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.0.0latest2026/09/092 个月前
0.11.02024/08/212 年前
0.10.02024/07/252 年前
0.9.02024/06/272 年前
0.8.02024/05/222 年前
0.6.02023/07/043 年前

关于 @harnessio/backstage-plugin-ci-cd 的常见问题

@harnessio/backstage-plugin-ci-cd 是什么?

Harness CI/CD plugin for Backstage. 1.0.0 targets Backstage 1.53 / React 18. Use 0.11.x for older Backstage.

如何安装 @harnessio/backstage-plugin-ci-cd?

在项目目录运行 npm install @harnessio/backstage-plugin-ci-cd,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.0.0)、react-dom(^18.0.0)、react-router(^6.3.0)、react-router-dom(^6.3.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@harnessio/backstage-plugin-ci-cd 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@harnessio/backstage-plugin-ci-cd 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@harnessio/backstage-plugin-ci-cd 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js 22 || 24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@harnessio/backstage-plugin-ci-cd 可以商用吗?

@harnessio/backstage-plugin-ci-cd 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@harnessio/backstage-plugin-ci-cd 的下载量有多少?

根据 npm 官方下载统计,@harnessio/backstage-plugin-ci-cd 在 2026/10/18 – 2026/11/16 这 30 天内被下载 5,607 次,日均约 187 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@harnessio/backstage-plugin-ci-cd 还在维护吗?

最新版本 1.0.0 发布于 2026/09/09(2 个月前);至今共发布 22 个版本,其中过去 12 个月发布了 1 个;首次发布于 2022/11/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。