1
0
Fork 0

added post action

This commit is contained in:
Christian Kühnel 2019-10-23 07:23:49 -07:00
parent 3cb057bc8f
commit f468ea1294

View file

@ -16,7 +16,11 @@ pipeline {
agent any
triggers {
pollSCM 'H H/2 * * *'
}
}
environment {
BUILD_ID='${JOB_BASE_NAME}-${BUILD_NUMBER}'
TARGET_DIR='/mnt/nfs/results/${BUILD_ID}'
}
stages {
stage("git checkout"){
steps {
@ -50,4 +54,20 @@ pipeline {
}
}
}
post {
always {
echo 'Postprocessing...'
// log console log to file
script {
def logContent = Jenkins.getInstance()
.getItemByFullName(env.JOB_NAME)
.getBuildByNumber(
Integer.parseInt(env.BUILD_NUMBER))
.logFile.text
writeFile file: "console-log.txt", text: logContent
}
sh 'cp console-log.txt ${env.TARGET_DIR}'
echo 'Console log is available at https://results.new.llvm-mgerge-guards/${env.BUILD_ID}'
}
}
}