README: Better declarative pipeline example

This commit is contained in:
mstg 2017-03-23 04:19:30 +01:00
parent 45477e0fae
commit 5c80f563e7
1 changed files with 8 additions and 1 deletions

View File

@ -141,9 +141,16 @@ The plugin supports the new [declarative pipeline syntax](https://github.com/jen
``` ```
pipeline { pipeline {
agent any agent any
post {
failure {
updateGitlabCommitStatus name: 'build', state: 'failed'
}
success {
updateGitlabCommitStatus name: 'build', state: 'success'
}
}
options { options {
gitLabConnection('<your-gitlab-connection-name') gitLabConnection('<your-gitlab-connection-name')
gitlabCommitStatus(name: 'jenkins')
} }
triggers { triggers {
gitlab(triggerOnPush: true, triggerOnMergeRequest: true, branchFilterType: 'All') gitlab(triggerOnPush: true, triggerOnMergeRequest: true, branchFilterType: 'All')