go-jenkins-trigger

command module
v0.0.0-...-6bfdd8f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 11 Imported by: 0

README

Jenkins Job Trigger in Go

Go Report Cart

GitHub Action to trigger Jenkins job and wait for the result, written in Go

Usage

Parpare your Jenkins Personal Access Token (PAT)

Check out How to get the API Token for Jenkins

Input Variables
Name Description
jenkins-url URL of Jenkins server. e.g., http://myjenkins.com:8080.
jenkins-user User name of Jenkins.
jenkins-pat Personal access token (PAT) for accessing Jenkins.
insecure true/false. Allow insecure Jenkins server connections when using SSL (default false).
job The name of the Jenkins job to run.
job-folders Optional, The folder paths of the job, can specify multiple or separate parameters with slashes, e.g., foo/bar
params Optional, The parameters of the job in key=value format, can specify multiple or separate parameters with commas, e.g., foo=bar,baz=qux.
params-json Optional, The parameters of the job in JSON format, e.g., {"foo":"bar","baz":"qux"}
wait true/false. Wait for the job to complete, and return the results (default true).
poll-time How often (duration) to poll the Jenkins server for results (default 10s)
max-attempts Max count of polling for results (default 60)
Example
jobs:
  trigger-jenkins:
    runs-on: ubuntu-latest
    steps:
      - id: myjob
        uses: shihyuho/go-jenkins-trigger@v2
        with:
          jenkins-url: "${{ secrets.JENKINS_URL }}"
          jenkins-user: "${{ secrets.JENKINS_USER }}"
          jenkins-pat: "${{ secrets.JENKINS_PAT }}"
          job: "${{ github.action }}"
          params: "event=${{ github.event_name }},ref=${{ github.ref }}"

See also: Access context information in workflows and actions

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL