handle yaml comments in context of build-notification
This commit is contained in:
parent
9439c6c1d6
commit
be7b2c48d4
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -103,11 +103,17 @@ pipeline {
|
|||||||
// get mail addresses
|
// get mail addresses
|
||||||
metadata = readFile(file: "${env.GIT_PATH}metadata.yaml").split('\n').each { line ->
|
metadata = readFile(file: "${env.GIT_PATH}metadata.yaml").split('\n').each { line ->
|
||||||
if(line.contains("- build-notification:")) {
|
if(line.contains("- build-notification:")) {
|
||||||
|
// remove yaml comments
|
||||||
|
if(line.contains('#')) {
|
||||||
|
line = line.substring(0, line.indexOf('#'))
|
||||||
|
}
|
||||||
def mailMatch = line =~ /[_A-Za-z0-9-]+(.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(.[A-Za-z0-9]+)*(.[A-Za-z]{2,})/
|
def mailMatch = line =~ /[_A-Za-z0-9-]+(.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(.[A-Za-z0-9]+)*(.[A-Za-z]{2,})/
|
||||||
|
if(mailMatch) {
|
||||||
env.RECIPIENTS += (mailMatch[0][0] + ";")
|
env.RECIPIENTS += (mailMatch[0][0] + ";")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
dir(env.GIT_PATH) {
|
dir(env.GIT_PATH) {
|
||||||
emailext attachmentsPattern: "diplomarbeit.pdf*",
|
emailext attachmentsPattern: "diplomarbeit.pdf*",
|
||||||
to: "${env.RECIPIENTS}",
|
to: "${env.RECIPIENTS}",
|
||||||
|
Loading…
Reference in New Issue
Block a user