Skip to content
activity

GitHub Action

Jenkins: Build Job

v0.1 Pre-release

Jenkins: Build Job

activity

Jenkins: Build Job

Builds a Jenkins job, returning its result

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Jenkins: Build Job

uses: HoldenLucas/[email protected]

Learn more about this action in HoldenLucas/build-jenkins-job

Choose a version

Build jenkins job docker action

This action runs a Jenkins job at a given URL with optional parameters.

Inputs

inputs:
  job_url:
    description: 'URL for the Jenkins job. i.e. http://jenkins.company.io/job/some-folder/job/test'
    required: true
  jenkins_token:
    description: 'Jekins API Token. 34 characters.'
    required: true
  jenkins_user:
    description: 'Your Jenkins User ID.'
    required: true
  job_params:
    description: 'JSON string of job parameters. i.e "{"foo": "bar", "baz": true, "qux": 3}" '
    required: false
    default: "{}"

Outputs

outputs:
  build_result:
    description: 'Result of the Jenkins build; SUCCESS UNSTABLE FAILURE NOT_BUILT ABORTED'

build_result

  • SUCCESS
  • UNSTABLE
  • FAILURE
  • NOT_BUILT
  • ABORTED

source

example

  - uses: HoldenLucas/build-jenkins-job@v1
    id: build
    with:
      job_url: ${{ secrets.JENKINS_URL }}/job/some-folder/job/test
      jenkins_token: ${{ secrets.JENKINS_TOKEN }}
      jenkins_user: ${{ secrets.JENKINS_USER }}
      job_params: "{"foo": "bar", "baz": true, "qux": 3}"

  - run: echo "Result: ${{ steps.build.outputs.build_result }}"