Merge branch 'master' of lcle/HTLLE-DA-Vorlage_Jenkinsfile into master
This commit is contained in:
commit
cf5842c2d0
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@ -65,7 +65,10 @@ pipeline {
|
|||||||
env.GIT_BRANCH = params.GIT_BRANCH ?: '*/master'
|
env.GIT_BRANCH = params.GIT_BRANCH ?: '*/master'
|
||||||
|
|
||||||
// output archive filename
|
// output archive filename
|
||||||
env.ARCHIVE_FILENAME = "diplomarbeit." + params.ARCHIVE_FORMAT
|
env.ARCHIVE_FILENAME = 'diplomarbeit.' + params.ARCHIVE_FORMAT
|
||||||
|
|
||||||
|
// if following files exist add them to the output archive
|
||||||
|
env.ARCHIVE_FILES = 'diplomarbeit.pdf diplomarbeit.pdf.log spellcheck-results.txt'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,10 +156,17 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
dir(env.GIT_PATH) {
|
dir(env.GIT_PATH) {
|
||||||
script {
|
script {
|
||||||
if (params.ARCHIVE_FORMAT == 'zip') {
|
env.FILES_TO_INCLUDE = ''
|
||||||
sh "zip -q ${env.ARCHIVE_FILENAME} diplomarbeit.pdf* spellcheck-results.txt"
|
def include = env.ARCHIVE_FILES.split(' ').each { filename ->
|
||||||
|
if (fileExists(filename)) {
|
||||||
|
env.FILES_TO_INCLUDE += (filename + ' ')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (env.ARCHIVE_FORMAT == 'zip') {
|
||||||
|
sh "zip -q ${env.ARCHIVE_FILENAME} ${env.FILES_TO_INCLUDE}"
|
||||||
} else {
|
} else {
|
||||||
sh "tar -czf ${env.ARCHIVE_FILENAME} diplomarbeit.pdf* spellcheck-results.txt"
|
sh "tar -czf ${env.ARCHIVE_FILENAME} ${env.FILES_TO_INCLUDE}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,7 +179,7 @@ pipeline {
|
|||||||
env.RECIPIENTS = ""
|
env.RECIPIENTS = ""
|
||||||
// get mail addresses
|
// get mail addresses
|
||||||
// needs script approval in jenkins
|
// needs script approval in jenkins
|
||||||
metadata = readFile(file: "${env.GIT_PATH}/metadata.yaml").split('\n').each { line ->
|
def 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
|
// remove yaml comments
|
||||||
if (line.contains('#')) {
|
if (line.contains('#')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user