Created
October 21, 2017 01:29
-
-
Save smalltown/efae5ead0649228e23b8d042a713ac6e to your computer and use it in GitHub Desktop.
Jenkins job DSL for integrating GitLab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.model.Jenkins | |
// define global variable | |
def job_folder = 'job_folder' | |
def job_name = 'job_name' | |
pipelineJob("${job_folder}/${job_name}") { | |
triggers { | |
gitlab { | |
triggerOnPush(true) | |
triggerOnMergeRequest(false) | |
triggerOpenMergeRequestOnPush('never') | |
triggerOnNoteRequest(false) | |
triggerOnAcceptedMergeRequest(true) | |
triggerOnClosedMergeRequest(false) | |
triggerOnPipelineEvent(true) | |
noteRegex('') | |
skipWorkInProgressMergeRequest(true) | |
ciSkip(true) | |
setBuildDescription(true) | |
addNoteOnMergeRequest(false) | |
addCiMessage(true) | |
addVoteOnMergeRequest(false) | |
acceptMergeRequestOnSuccess(false) | |
branchFilterType('All') | |
includeBranchesSpec('') | |
excludeBranchesSpec('') | |
targetBranchRegex('') | |
mergeRequestLabelFilterConfig { | |
include('') | |
exclude('') | |
} | |
secretToken('') | |
} | |
} | |
definition { | |
cps { | |
script(readFileFromWorkspace("pipeline/${job_folder}/${job_name}.groovy")) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment