How do I configure a Jenkins Pipeline to be triggered by polling SubVersion?

前端 未结 6 2210
逝去的感伤
逝去的感伤 2020-12-09 04:42

We have been using Jenkins for Continuous Integration for some time. A typical build job specifies the SVN repository and credentials in the \"Source Code Management\" secti

6条回答
  •  误落风尘
    2020-12-09 05:00

    As an alternative to when the pipeline script is not part of the project or is defined in the job, you can add poll: true to your checkout stage.

    Example:

    stage('checkout') {
        checkout(
            changelog: true, 
            poll: true, /*This is the important option*/
            scm: [
                $class: 'SubversionSCM', 
                filterChangelog: false, 
                ignoreDirPropChanges: false,
                locations: [...], /*ommited for obvious reasons*/
                workspaceUpdater: [$class: 'CheckoutUpdater']
            ])
    }
    

    After the first run it will start polling from this SCM also as from the SCM where the pipeline is if it is the case.

    This option is documented at https://jenkins.io/doc/pipeline/steps/workflow-scm-step/#code-checkout-code-general-scm , in the very end of the page without details.

提交回复
热议问题