Last active
May 4, 2016 18:07
-
-
Save jglick/cc0cdd5d0c77d50a1339b0d120fcb513 to your computer and use it in GitHub Desktop.
example for sobersabre on #jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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