Skip to content

Instantly share code, notes, and snippets.

@boxrick
Created May 14, 2018 13:46
Show Gist options
  • Save boxrick/3181f5796848c3df6938c6fff800993c to your computer and use it in GitHub Desktop.
Save boxrick/3181f5796848c3df6938c6fff800993c to your computer and use it in GitHub Desktop.
example
pipelineJob('test2') {
logRotator {
numToKeep(10)
}
definition {
cps {
script("""
pipeline
{
parameters {
booleanParam(defaultValue: true, description: '', name: 'userFlag')
}
options
{
buildDiscarder(logRotator(numToKeepStr: '100'))
}
agent any
stages {
stage("foo") {
steps {
echo "flag: ${params.userFlag}"
}
}
}
}
""".stripIndent())
sandbox()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment