--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/966a8838-f95a-4c23-ac61-e4c7356fac8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Sverre,
On 11.10.2018 09:33, Sverre Moe wrote:
[snip]
> Is there some other means I can make sure that the build has a clean
> workspace?
Our Windows agents are virtual machines that get reset to a certain
snapshot to make sure they are clean.
node(nodeName) {
unstash 'archive'
sh "tar -zxf ${projectName}.tar.gz"
try {
tool name: 'gradle-4.8', type: 'gradle'
sh "gradle ${javaOptions} --refresh-dependencies ${buildTask} ${releaseProperty} -Pheadless"
stash allowEmpty: true, includes: "build/**/*.rpm", name: stashName
/* Archive Linux FPM packages */
archiveArtifacts allowEmptyArchive: true, artifacts: "build/**/*.rpm", onlyIfSuccessful: true
/* Archive Windows native executables. */
archiveArtifacts allowEmptyArchive: true, artifacts: "build/**/*.exe", excludes: "build/**/${projectName}/*.exe", onlyIfSuccessful: true
} catch (e) {
throw e
} finally {
try {
deleteDir()
} catch (e) {
println e
}
}
}