Run Jenkins Job

Action ID: jenkins:job:build
NPM Package:

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

Description

Run an existing job jenkins given a name

Input Schema

PropertyTypeDescriptionRequired
jobNamestringName of jenkins item
jobParametersobject-

Output Schema

No output schema defined for this action.

Usage Examples

Trigger a Jenkins seed job without parameters

Runs a pre-existing seed job to initialize pipeline configuration for the new service. Use this after fetch:template and publish:github when the Jenkins job does not require parameters.

Copy
steps:
  - id: fetchBase
    action: fetch:template
    input:
      url: https://github.com/acme/templates/service-skeleton/archive/main.zip
      targetPath: .
      values:
        name: ${{ parameters.componentId }}
        owner: ${{ parameters.owner }}

  - id: triggerSeedJob
    action: jenkins:job:build
    input:
      jobName: seed/${{ parameters.organization }}/setup-pipelines

Build and deploy with parameterized Jenkins pipeline

Triggers a foldered Jenkins pipeline with parameters to build the image and deploy to the selected environment. Use this to start CI and an initial deploy after scaffolding.

Copy
steps:
  - id: fetchBase
    action: fetch:template
    input:
      url: https://github.com/acme/templates/node-service/archive/main.zip
      targetPath: .
      values:
        name: ${{ parameters.componentId }}
        description: ${{ parameters.description }}

  - id: triggerCiCd
    action: jenkins:job:build
    input:
      jobName: ci/${{ parameters.teamSlug }}/build-and-deploy
      jobParameters:
        repository: github.com/acme/${{ parameters.repoName }}
        branch: ${{ parameters.defaultBranch }}
        imageTag: ${{ parameters.version }}
        environment: ${{ parameters.environment }}
        deploy: true
        timeoutMinutes: 30
        notifyChannel: '#svc-ci'