Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-circle

GitHub Action

Trigger Jenkins Multiple Jobs

v0.0.2

Trigger Jenkins Multiple Jobs

check-circle

Trigger Jenkins Multiple Jobs

Triggering Jenkins Job through the API

Installation

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

              

- name: Trigger Jenkins Multiple Jobs

uses: appleboy/jenkins-action@v0.0.2

Learn more about this action in appleboy/jenkins-action

Choose a version

🚀 Trigger Jenkins Job for GitHub Actions

GitHub Action for trigger jenkins jobs.

jenkins

Usage

Trigger New Jenkins Job.

name: trigger jenkins job
on: [push]
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
    - name: trigger single Job
      uses: appleboy/jenkins-action@master
      with:
        url: "http://example.com"
        user: "example"
        token: ${{ secrets.TOKEN }}
        job: "foobar"

Jenkins Setting

Setup the Jenkins server using the docker command:

docker run \
  --name jenkins \
  -d --restart always \
  -p 8080:8080 -p 50000:50000 \
  -v /data/jenkins:/var/jenkins_home \
  jenkins/jenkins:lts

Please make sure that you create the /data/jenkins before starting the Jenkins. Create the new API token as below:

jenkins

Example

Trigger multiple jenkins job:

- name: trigger multiple Job
  uses: appleboy/jenkins-action@master
  with:
    url: "http://example.com"
    user: "example"
    token: ${{ secrets.TOKEN }}
    job: "job_1,job_2"

Input variables

  • url - Required. jenkins base url.
  • user - Required. jenkins user.
  • job - Required. jenkins job name.
  • token - Required. jenkins api token.