1

I am new to Jenkins Pipeline Script, I have moved my FreeStyle project to a Pipeline but am not able to get my Master server to wake up when I make a commit to my SVN repo. Here is my first couple of lines and where my SVN credentials are declared:

node {
try {
    notifyBuild('STARTED')

stage('Checkout') {
checkout([$class: 'SubversionSCM',
    additionalCredentials: [], 
    excludedCommitMessages: '', 
    excludedRegions: '', 
    excludedRevprop: '', 
    excludedUsers: 'buildbot', 
    filterChangelog: false, 
    ignoreDirPropChanges: false, 
    includedRegions: '', 
    locations: [[credentialsId: 'my-login-id-creds-are-here', 
        depthOption: 'infinity', 
        ignoreExternalsOption: true, 
        local: '.', 
        remote: "http://this.is.myweburl.com/svn/path/to/branch"]],
    workspaceUpdater: [$class: 'UpdateUpdater']])
}

Is there a way to poll SCM?

Let me know if you have any questions.

Thanks!

robd
  • 9,646
  • 5
  • 40
  • 59
Lgalan90
  • 595
  • 2
  • 12
  • 31

3 Answers3

1

Did you try to add properties in Jenkinsfile to have time trigger?

properties([
   pipelineTriggers([cron('H/30 * * * *')])
])

see this

There are different way of doing this in scripted and declarative pipeline, and both will create related parameter into your jenkins job after executed in first time.

Larry Cai
  • 55,923
  • 34
  • 110
  • 156
0

Here's a short checklist:

  • In your Pipeline job, under "Build Triggers", configure "Poll SCM" (eg. H/2 * * * * to poll every 2 minutes)
  • If you recently edited your pipeline script and changed the SVN configuration within it (eg. change of branch to poll), you may need to click "Build Now" once to update SVN polling configuration.
  • Check your SCM filters (included*/excluded*). In the example provided I see you filter out commits by 'buildbot', make sure that's not the case.
  • Timezone and time sync issues: make sure correct timezone and date/time are configured correctly both on the SVN and Jenkins Master server. Appending "@HEAD" to the SVN URL may save some time sync headaches (eg. http://this.is.myweburl.com/svn/path/to/branch@HEAD).
  • Check the "Subversion Polling Log" in the job page, might help troubleshooting network/credential issues.
Oren Chapo
  • 519
  • 7
  • 15
0

I was seeing this exact issue, even after following the answers here. For me the reason why Jenkins wasn't polling was that about 10 builds ago I had run a build with no scm checkout step which passed, but all subsequent builds (which did have scm checkout steps) failed.

I think Jenkins ignores these, possibly caused by this WorkflowJob code.

robd
  • 9,646
  • 5
  • 40
  • 59