Skip to content

Instantly share code, notes, and snippets.

@jglick
Last active May 4, 2016 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jglick/cc0cdd5d0c77d50a1339b0d120fcb513 to your computer and use it in GitHub Desktop.
Save jglick/cc0cdd5d0c77d50a1339b0d120fcb513 to your computer and use it in GitHub Desktop.
example for sobersabre on #jenkins
def multiwrap(wrappers, body) {
_multiwrap(wrappers, 0, body)
}
def _multiwrap(wrappers, idx, body) {
if (idx == wrappers.size()) {
body()
} else {
wrap(wrappers.get(idx)) {
_multiwrap(wrappers, idx + 1, body)
}
}
}
node {
multiwrap([[$class: 'TimestamperBuildWrapper'],
[$class: 'ConfigFileBuildWrapper', managedFiles: [[fileId: 'myfile', variable: 'FILE']]]]) {
sh 'cat $FILE'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment