docs: add drone documents. (#11)

This commit is contained in:
Bo-Yi Wu
2017-01-17 10:58:32 +08:00
committed by GitHub
parent e07592691c
commit 7d040a545c
4 changed files with 381 additions and 0 deletions
+96
View File
@@ -0,0 +1,96 @@
---
date: 2017-01-16T00:00:00+00:00
title: Jenkins
author: appleboy
tags: [ infrastructure, trigger, jenkins ]
repo: appleboy/drone-jenkins
logo: jenkins.svg
image: appleboy/drone-jenkins
---
The Jenkins plugin allows you to trigger Jenkins job automatically. The below pipeline configuration demonstrates simple usage:
```yaml
pipeline:
jenkins:
image: appleboy/drone-jenkins
url: http://example.com
user: appleboy
token: xxxxxxxxxx
job: drone-jenkins-plugin-job
```
Example configuration for success builds:
```diff
pipeline:
jenkins:
image: appleboy/drone-jenkins
url: http://example.com
user: appleboy
token: xxxxxxxxxx
job: drone-jenkins-plugin-job
+ when:
+ status: [ success ]
```
Example configuration with multiple jobs:
```yaml
pipeline:
jenkins:
image: appleboy/drone-jenkins
url: http://example.com
user: appleboy
token: xxxxxxxxxx
job:
+ - drone-jenkins-plugin-job-1
+ - drone-jenkins-plugin-job-2
```
Example configuration with jobs in the folder:
```yaml
pipeline:
jenkins:
image: appleboy/drone-jenkins
url: http://example.com
user: appleboy
token: xxxxxxxxxx
+ job: folder_name/job_name
```
It will trigger the URL of Jenkins job like as `http://example.com/job/folder_name/job/job_name/`
# Secrets
The Jenkins plugin supports reading credentials from the Drone secret store. This is strongly recommended instead of storing credentials in the pipeline configuration in plain text.
```diff
pipeline:
jenkins:
image: appleboy/drone-jenkins
url: http://example.com
user: appleboy
- token: xxxxxxxxxx
job: drone-jenkins-plugin-job
```
The `token` attribute can be replaced with the below secret environment variables. Please see the Drone documentation to learn more about secrets.
PLUGIN_TOKEN
: user token
# Parameter Reference
url
: jenkins server base url.
user
: jenkins user account
token
: jenkins user token
job
: jenkins job name
+2
View File
@@ -1,3 +1,5 @@
<img src="logo.png">
# drone-jenkins
[![GoDoc](https://godoc.org/github.com/appleboy/drone-jenkins?status.svg)](https://godoc.org/github.com/appleboy/drone-jenkins) [![Build Status](http://drone.wu-boy.com/api/badges/appleboy/drone-jenkins/status.svg)](http://drone.wu-boy.com/appleboy/drone-jenkins) [![codecov](https://codecov.io/gh/appleboy/drone-jenkins/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/drone-jenkins) [![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/drone-jenkins)](https://goreportcard.com/report/github.com/appleboy/drone-jenkins) [![Docker Pulls](https://img.shields.io/docker/pulls/appleboy/drone-jenkins.svg)](https://hub.docker.com/r/appleboy/drone-jenkins/) [![](https://images.microbadger.com/badges/image/appleboy/drone-jenkins.svg)](https://microbadger.com/images/appleboy/drone-jenkins "Get your own image badge on microbadger.com")
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

+283
View File
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 29 KiB