I\'m running Jenkins 2 with the Pipeline plugin. I have setup a Multi-branch Pipeline project where each branch (master, develop, etc.) has a Jenkinsfile in the root. Settin
I was able to find an example illustrating this an discarding old builds, which is also something I wanted.
Jenkinsfile in jenkins-infra/jenkins.io:
properties(
[
[
$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', numToKeepStr: '10']
],
pipelineTriggers([cron('H/30 * * * *')]),
]
)