Delete Jenkins Job

Action ID: jenkins:job:destroy
NPM Package:

@backstage-community/plugin-scaffolder-backend-module-jenkins

Description

Destroy an existing job jenkins given a name

Input Schema

PropertyTypeDescriptionRequired
jobNamestringName of jenkins item

Output Schema

No output schema defined for this action.

Usage Examples

Remove a branch-specific Jenkins job after a feature branch is merged

Use this to clean up ephemeral Jenkins jobs created per branch. Place this step after repository merge or clean-up logic and after a fetch:template step if you generated values earlier.

Copy
steps:
  - id: destroy-branch-job
    action: jenkins:job:destroy
    input:
      jobName: ci/${{ parameters.serviceSlug }}-${{ parameters.branchName }}

Decommission a service by deleting its Jenkins pipeline job

Use this when retiring a service or migrating CI to another system. The job name can be the full Jenkins folder path provided by the user input.

Copy
steps:
  - id: destroy-service-pipeline
    action: jenkins:job:destroy
    input:
      jobName: ${{ parameters.jenkinsJobName }}  # e.g. platform/services/payments-service