def work = 'tmp/'
try {
node {
dir(work) {
git url: 'g...@github.com:zanata/zanata-parent.git'
sh 'ls -l'
}
archive work
}
node {
sh 'rm -rf -- *'
unarchive mapping: [(work) : '.']
dir(work) {
sh 'ls -l'
archive '**/pom.xml,**/target/*.jar,**/target/*.war'
}
}
} finally {
node('master') {
//def buildNumber = System.getenv()['BUILD_NUMBER']
sh "rm -rf -- ../builds/*/archive/$work"
}
}
I would greatly prefer to delete archive/$work from the current build only (instead of builds/*), but I don't know how to access the build number from the workflow, or whether that even makes sense in a workflow.
If anyone has other ideas or suggestions, please let me know!