Commit 2b2516b0 authored by Arno Bauernoppel's avatar Arno Bauernoppel
Browse files

added postbuild step

parent 34b5a9a0
......@@ -166,8 +166,6 @@ pkgs.each { pkg ->
disableConcurrentBuilds()
]
def log = manager.build.logFile.text
try {
stage('Build Debian Package') {
node ('${build_node_label}') {
......@@ -256,32 +254,41 @@ pkgs.each { pkg ->
}
}
}
post {
def log = manager.build.logFile.text
always {
if(currentBuild.result == 'SUCCESS') {
emailext body: '\${DEFAULT_CONTENT}',
replyTo: '${email_from}',
subject: '[arm02] SUCCESS: ' + '\${DEFAULT_SUBJECT}',
to: '${email_to}'
}
}
failure {
if (currentBuild.result == 'UNSTABLE') {
emailext body: '\${DEFAULT_CONTENT}' + "\\n --- \\n" + log,
replyTo: '${email_from}',
subject: '[arm02] UNSTABLE Tests failed: ' + '\${DEFAULT_SUBJECT}' + ' (skipped upload)',
to: '${email_to}'
} else {
currentBuild.result = 'FAILURE'
emailext body: '\${DEFAULT_CONTENT}' + "\\n --- \\n" + log,
replyTo: '${email_from}',
subject: '[arm02] FAILED: ' + '\${DEFAULT_SUBJECT}',
to: '${email_to}'
// Rethrow error
throw err
}
}
}
} catch(err) {
if(currentBuild.result == 'NOT_BUILT') {
print "Build aborted. Build criteria not met."
} else if (currentBuild.result == 'UNSTABLE') {
emailext body: '\${DEFAULT_CONTENT}' + "\\n --- \\n" + log,
replyTo: '${email_from}',
subject: '[arm02] UNSTABLE Tests failed: ' + '\${DEFAULT_SUBJECT}' + ' (skipped upload)',
to: '${email_to}'
} else {
currentBuild.result = 'FAILURE'
emailext body: '\${DEFAULT_CONTENT}' + "\\n --- \\n" + log,
replyTo: '${email_from}',
subject: '[arm02] FAILED: ' + '\${DEFAULT_SUBJECT}',
to: '${email_to}'
// Rethrow error
throw err
}
} finally {
if(currentBuild.result == 'SUCCESS') {
emailext body: '\${DEFAULT_CONTENT}',
replyTo: '${email_from}',
subject: '[arm02] SUCCESS: ' + '\${DEFAULT_SUBJECT}',
to: '${email_to}'
}
cleanWs cleanWhenFailure: false, cleanWhenSuccess: true, deleteDirs: true
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment