Drone plugin for trigger Jenkins jobs.

drone-jenkins

logo

GoDoc Build Status codecov Go Report Card Docker Pulls microbadger

Drone plugin for trigger Jenkins jobs.

Setup the Jenkins Server

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 token

Build or Download a binary

The pre-compiled binaries can be downloaded from release page. Support the following OS type.

  • Windows amd64/386
  • Linux amd64/386
  • Darwin amd64/386

With Go installed

go get -u -v github.com/appleboy/drone-jenkins

or build the binary with the following command:

make build

Docker

Build the docker image with the following commands:

make docker

Usage

There are three ways to trigger jenkins jobs.

Usage from binary

trigger single job.

drone-jenkins \
  --host http://jenkins.example.com/ \
  --user appleboy \
  --token XXXXXXXX \
  --job drone-jenkins-plugin

trigger multiple jobs.

drone-jenkins \
  --host http://jenkins.example.com/ \
  --user appleboy \
  --token XXXXXXXX \
  --job drone-jenkins-plugin-1 \
  --job drone-jenkins-plugin-2

Usage from docker

trigger single job.

docker run --rm \
  -e JENKINS_BASE_URL=http://jenkins.example.com/
  -e JENKINS_USER=appleboy
  -e JENKINS_TOKEN=xxxxxxx
  -e JENKINS_JOB=drone-jenkins-plugin
  appleboy/drone-jenkins

trigger multiple jobs.

docker run --rm \
  -e JENKINS_BASE_URL=http://jenkins.example.com/
  -e JENKINS_USER=appleboy
  -e JENKINS_TOKEN=xxxxxxx
  -e JENKINS_JOB=drone-jenkins-plugin-1,drone-jenkins-plugin-2
  appleboy/drone-jenkins

Usage from drone ci

Execute from the working directory:

docker run --rm \
  -e PLUGIN_URL=http://example.com \
  -e PLUGIN_USER=xxxxxxx \
  -e PLUGIN_TOKEN=xxxxxxx \
  -e PLUGIN_JOB=xxxxxxx \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  appleboy/drone-jenkins

You can get more information about how to use scp plugin in drone.

Testing

Test the package with the following command:

make test
Owner
Bo-Yi Wu
I really believe committing every day on an open source project is the best practice.
Bo-Yi Wu
Similar Resources

Set of Kubernetes solutions for reusing idle resources of nodes by running extra batch jobs

Caelus Caelus is a set of Kubernetes solutions for reusing idle resources of nodes by running extra batch jobs, these resources come from the underuti

Nov 22, 2022

Kubectl Locality Plugin - A plugin to get the locality of pods

Kubectl Locality Plugin - A plugin to get the locality of pods

Nov 18, 2021

A kubernetes plugin which enables dynamically add or remove GPU resources for a running Pod

A kubernetes plugin which enables dynamically add or remove GPU resources for a running Pod

GPU Mounter GPU Mounter is a kubernetes plugin which enables add or remove GPU resources for running Pods. This Introduction(In Chinese) is recommende

Jan 5, 2023

Dothill (Seagate) AssuredSAN dynamic provisioner for Kubernetes (CSI plugin).

Dothill-csi dynamic provisioner for Kubernetes A dynamic persistent volume (PV) provisioner for Dothill AssuredSAN based storage systems. Introduction

Oct 11, 2022

Fast docker image distribution plugin for containerd, based on CRFS/stargz

Fast docker image distribution plugin for containerd, based on CRFS/stargz

[ ⬇️ Download] [ 📔 Browse images] [ ☸ Quick Start (Kubernetes)] [ 🤓 Quick Start (nerdctl)] Stargz Snapshotter Read also introductory blog: Startup C

Dec 29, 2022

Kubectl plugin to ease sniffing on kubernetes pods using tcpdump and wireshark

Kubectl plugin to ease sniffing on kubernetes pods using tcpdump and wireshark

ksniff A kubectl plugin that utilize tcpdump and Wireshark to start a remote capture on any pod in your Kubernetes cluster. You get the full power of

Jan 4, 2023

MenuStart plugin to nwg-panel, also capable of working standalone

MenuStart plugin to nwg-panel, also capable of working standalone

nwg-menu This code provides the MenuStart plugin to nwg-panel. It also may be used standalone, however, with a little help from command line arguments

Sep 9, 2022

Snowflake grafana datasource plugin allows Snowflake data to be visually represented in Grafana dashboards.

Snowflake grafana datasource plugin allows Snowflake data to be visually represented in Grafana dashboards.

Snowflake Grafana Data Source With the Snowflake plugin, you can visualize your Snowflake data in Grafana and build awesome chart. Get started with th

Dec 29, 2022

A helm v3 plugin to get values from a previous release

helm-val helm-val is a helm plugin to fetch values from a previous release. Getting started Installation To install the plugin: $ helm plugin install

Dec 11, 2022
Comments
  • add handling for jenkins XSRF

    add handling for jenkins XSRF

    hello we have a Jenkins with XSRF I've allowed myself to add a simple example of how to handle the XSRF token to your client.

    I would be happy if the code or something similar is included in your client

    I've added a few log messages, so you can see what the plugin is doing at work

    Please feel free to change my code, it is just a suggestion

  • Feature/job paramter

    Feature/job paramter

    hello @appleboy , i will open a PR for feedback.

    The tests are running in my lokal setup well and also in my drone.ci.

    You found an CSRF handling; the options to push values into the job and an full scripted jenkins test setup.

    Are there also changes in the plugin interface necessary?

  • XSRF support

    XSRF support

    hello, an external jenkins use XSRF protection. i has found the information over XSRF protection in the api of the jenkins and write a fanction to add the XSRF header if XSRF protection is active.

    Are you interresset to merge the function into the main repo - i can open an PR

  • 怎么调用jenkins?job字段应该怎么写

    怎么调用jenkins?job字段应该怎么写

    1. 在jenkins job test-drone里面设置了token, 选择“触发远程构建”->输入口令牌“123456”
    2. 我的jenkins访问地址是http://128.10.8.9:8080/jenkins, admin是我的jenkins用户
    3. 新建了一个job,job路径为http://128.10.8.9:8080/jenkins/job/test-drone 我的.drone.yml

    pipeline: jenkins: image: appleboy/drone-jenkins url: http://128.10.8.9:8080/jenkins user: admin token: 123456 job: test-drone

    按如下格式。但是并没有输入任何日志。也没调起jenkins job。需要怎么处理呢?谢谢

Jenkins CLI allows you manage your Jenkins as an easy way

Quick start 简体中文 Jenkins CLI Jenkins CLI allows you manage your Jenkins in an easy way. No matter if you're a plugin developer, administrator or just

Jan 4, 2023
A plugin for Hashicorp Vault to create ephemeral users and API tokens for Jenkins CI
A plugin for Hashicorp Vault to create ephemeral users and API tokens for Jenkins CI

vault-plugin-secrets-jenkins This is a backend plugin to be used with Hashicorp Vault. This plugin generates ephemeral Jenkins Users and API tokens. v

Dec 15, 2022
Drone plugin to skip pipelines based on changed files

drone-skip-pipeline Drone plugin to skip pipelines based on changed files. Build Build the binary with the following command: export GOOS=linux export

Aug 7, 2022
Drone plugin to create comment and label in PR to Gitee
Drone plugin to create comment and label in PR to Gitee

drone-plugin-gitee-pulls 中文文档 Drone plugin to create comment and label in PR to

Sep 6, 2022
CI/CD with Jenkins, GitHub Actions, Travis CI etc

CI/CD with Jenkins, GitHub Actions, Travis CI etc This is a simple repository built using Golang with the main purpose to try out different CI/CD tool

Nov 11, 2021
Copy files and artifacts via SSH using a binary, docker or Drone CI.

drone-scp Copy files and artifacts via SSH using a binary, docker or Drone CI. Feature Support routines. Support wildcard pattern on source list. Supp

Dec 6, 2022
Woodpecker is a community fork of the Drone CI system.
Woodpecker is a community fork of the Drone CI system.

Woodpecker is a community fork of the Drone CI system.

Jan 5, 2023
Drone conversion for platform values

drocopla A drone.io conversion extension to set host platform as drone pipeline platform. Default drone.io behaviour: If os/arch is not set in .drone.

Dec 1, 2021
Blast is a simple tool for API load testing and batch jobs

Blast Blast makes API requests at a fixed rate. The number of concurrent workers is configurable. The rate may be changed interactively during executi

Nov 10, 2022
Terrform Provider for Managing Dkron Jobs

Terraform Provider Dkron Provider for managing https://dkron.io/ jobs. Usage examples terraform { required_providers { dkron = { version =

Oct 17, 2022