Created
August 22, 2016 05:31
-
-
Save ar45/49a98be9345c1e6236e72621a9ea1818 to your computer and use it in GitHub Desktop.
Jenkins extract commit from comment
This file contains hidden or 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
def thr = Thread.currentThread() | |
def build = thr?.executable | |
def env = build.getBuildVariables() | |
//def env = build.getEnvironment() | |
println env | |
def ghprbCommentBody = env.get("ghprbCommentBody") | |
println "ghprbCommentBody=$ghprbCommentBody" | |
def map = [BACKEND_TARGET_BRANCH: "refs/remotes/origin/master"] | |
def match = (ghprbCommentBody =~ /jenkins retest this please against ([0-9a-zA-Z]+)/) | |
if (match) { | |
map = [BACKEND_TARGET_BRANCH: match[0][1]] | |
} | |
println map | |
return map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment