added post action
This commit is contained in:
parent
3cb057bc8f
commit
f468ea1294
1 changed files with 21 additions and 1 deletions
22
Jenkins/master-pipeline/Jenkinsfile
vendored
22
Jenkins/master-pipeline/Jenkinsfile
vendored
|
@ -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}'
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue