Giter Club home page Giter Club logo

jenkins-trigger's Introduction

Jenkins job trigger action

Github Action to trigger jenkins job and wait for job completion using Jenkins API.
Welcome your feedback and request. ๐Ÿ‘

Usage

Generate API token for Jenkins API

Please see How to get the API Token for Jenkins

  1. Log in Jenkins.
  2. Click you name (upper-right corner).
  3. Click Configure (left-side menu).
  4. Use "Add new Token" button to generate a new one then name it.
  5. You must copy the token when you generate it as you cannot view the token afterwards.
  6. Revoke old tokens when no longer needed.

Inputs

name required description
url true Jenkins full URL including http/https protocol
user_name true User name of Jenkins
api_token true Jenkins API token
job_name true Jenkins job name
parameter false Job parameter in JSON format. ex) {"param1":"value1"}
headers false Additional headers to include in the HTTP requests in JSON format. ex) {"param1":"value1"}
wait false Set true as default. Waiting for job completion or not
timeout false Set 600 seconds as default. Timeout (seconds) for github action.

Example

- name: Trigger jenkins job
  uses: feiguoL/jenkins-trigger@main
  id: generate_url
  with:
    url: ${{ secrets.JENKINS_URL }}
    job_name: "build_web_application"
    user_name: ${{ secrets.JENKINS_USER }}
    api_token: ${{ secrets.JENKINS_TOKEN }}
    wait: "true"
    timeout: "1000"
- name: print_url
  run: |
    echo "pipeline run link url: ${{ steps.generate_url.outputs.jobUrl }}, runId: ${{ steps.generate_url.outputs.runId }}"

jenkins-trigger's People

Contributors

jmcgill-nz avatar joshlk avatar estherk0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.