Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/appleboy/jenkins-action
GitHub Action that trigger Jenkins job.
https://github.com/appleboy/jenkins-action
github-actions jenkins
Last synced: 2 months ago
JSON representation
GitHub Action that trigger Jenkins job.
- Host: GitHub
- URL: https://github.com/appleboy/jenkins-action
- Owner: appleboy
- License: mit
- Created: 2019-03-02T01:37:33.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-13T03:05:49.000Z (almost 4 years ago)
- Last Synced: 2024-05-21T07:34:59.955Z (8 months ago)
- Topics: github-actions, jenkins
- Language: Dockerfile
- Homepage: https://github.com/marketplace/actions/trigger-jenkins-multiple-jobs
- Size: 203 KB
- Stars: 90
- Watchers: 5
- Forks: 31
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Trigger multiple Jenkins Jobs
- fucking-awesome-actions - Trigger multiple Jenkins Jobs
- awesome-workflows - Trigger multiple Jenkins Jobs
README
# 🚀 Trigger Jenkins Job for GitHub Actions
[GitHub Action](https://github.com/features/actions) for trigger [jenkins](https://jenkins.io/) jobs.
![jenkins](./images/trigger-jenkins.png)
## Usage
Trigger New Jenkins Job.
```yaml
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:
```sh
docker run \
--name jenkins-docker \
-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.
Go to user profile and click on `Configure`:
![jenkins](./images/register-token.png)
## Example
Trigger multiple jenkins job:
```yaml
- name: trigger multiple Job
uses: appleboy/[email protected]
with:
url: http://example.com
user: example
token: ${{ secrets.TOKEN }}
job: job_1,job_2
```Trigger jenkins job with parameter:
```yaml
- name: trigger Job with parameter
uses: appleboy/[email protected]
with:
url: http://example.com
user: example
token: ${{ secrets.TOKEN }}
job: job_1
parameters: param1=value1,param2=value2
```## Input variables
* url - Required. jenkins base url.
* user - Required. jenkins user.
* job - Required. jenkins job name.
* token - Required. jenkins api token.
* insecure - Optional. Allow insecure server connections when using SSL. Default is `false`.
* parameters - Optional. jenkins job parameter, example: `param1=value1,param2=value2`.