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

前端 未结 6 2209
逝去的感伤
逝去的感伤 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 04:56

    I think you need a Checkout stage before before your Build stage, which consists of the SCM information. This allows the job to Poll SCM at the desired interval and run the pipeline.

    You can even use Pipeline script, without having the pipeline codes to store as a JenkinsFile in SCM.

    Below is my SVN Checkout stage pipeline code before my Build stage:

    stage('Checkout') {
        checkout([$class: 'SubversionSCM', 
            additionalCredentials: [], 
            excludedCommitMessages: '', 
            excludedRegions: '', 
            excludedRevprop: '', 
            excludedUsers: 'buildbot', 
            filterChangelog: false, 
            ignoreDirPropChanges: false, 
            includedRegions: '', 
            locations: [[credentialsId: 'b86bc2b6-994b-4811-ac98-0f35e9a9b114', 
                depthOption: 'infinity', 
                ignoreExternalsOption: true, 
                local: '.', 
                remote: "http://svn/something/trunk/"]],
            workspaceUpdater: [$class: 'UpdateUpdater']])
    }
    

    Works for my pipeline job though. Hope this helps.

提交回复
热议问题