So we had a lot of problems to get this to work. Here's how we solved the problem:
In Jenkins, you work on the assembly line . The only content required in this work:
- POLL SCM (with some arbitrary value like
@monthly ) - Where should work find your Jenkinsfile
All other settings are included in the Jenkinsfile file . Anyway:
triggers { pollSCM('@monthly')}
Should still be specified in your Jenkinsfile, even if it is already specified in your work.
However, as zionyx said , you need to place an order before doing anything else. In our case, we wanted to avoid this for many reasons. Fortunately, this still works if you have: depthOption: 'empty' .
Finally, you need to manually start the first run of the job .
We made a small function that you can use:
def checkoutSVN(Boolean ignoreExternalsOption, String local, String remote, String updater) { checkout([$class: 'SubversionSCM', additionalCredentials: [[credentialsId: 'get-this-from-your-jenkins', realm: '<https://your-server> CollabNet Subversion Repository']], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[credentialsId: 'get-this-from-your-jenkins', depthOption: 'empty', ignoreExternalsOption: ignoreExternalsOption, local: local, remote: remote]], quietOperation: false, workspaceUpdater: [$class: updater]])}