diff --git a/Jenkinsfile b/Jenkinsfile index 9121d0d48cf..27f97aa4b14 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,18 +107,11 @@ pipeline { mapParallelTasks["${k}"] = v } } + notifyBuildReason() parallel(mapParallelTasks) } } } - post { - always { - dir("${BASE_DIR}"){ - // Archive the markdown files that contain the build reasons - archiveArtifacts(allowEmptyArchive: false, artifacts: 'build-reasons/*.md') - } - } - } } } post { @@ -546,6 +539,17 @@ def isDockerInstalled(){ } } +/** +* Notify the build reason. +*/ +def notifyBuildReason() { + // Archive the build reason here, since the workspace can be deleted when running the parallel stages. + archiveArtifacts(allowEmptyArchive: true, artifacts: 'build-reasons/*.*') + if (isPR()) { + echo 'TODO: Add a comment with the build reason (this is required to be implemented in the shared library)' + } +} + /** * This class is the one used for running the parallel stages, therefore * its arguments are passed by the beatsStages step.