1

I have scheduled the jenkins job at 7 pm at evening... But whenever the changes observed in SVN then only the job should run or else it should not trigger even the job is scheduled at 7 pm Please help me with the powershell script to not run the job or the job should exit when no change occur in SVN even scheduler is there also... Please help me out with this..

G.A
  • 11
  • 5
  • [PollSCM](https://www.jenkins.io/doc/book/pipeline/syntax/#triggers), not cron – Ian W Jul 07 '22 at 10:21
  • @lan W I dont want to configure any post commit hook in svn... then how pollscm will work? – G.A Jul 07 '22 at 10:23
  • You don't need a hook. PollSCM is Jenkins cron but knowing the last build's commit. The preference is a post-commit hook since that initiates the build only on commit, whereas pollSCM still polls ("is there a new commit?") only on the interval. 1000s of jobs polling every few mins is most inefficient. – Ian W Jul 08 '22 at 06:47
  • @lan W we have configured the jenkins file pipeline in that we have so many jobs to run... In those jobs this SVN commit job is one. This pipeline will run all those jobs as one stage.That pipeline used to run on dialy basis at evening 7PM. Now if I configure poll SCM in SVN job then pipeline will detect that poll SCM correctly at that pipeline triggering time?... Or for this any powershell command is available?.. please help me... – G.A Jul 09 '22 at 02:33
  • Not sure I understand your question. Just change your pipeline step from [`cron` to `pollSCM`](https://stackoverflow.com/a/44530217/598141). no need for PowerShell. In fact we have jobs that both pollSCM daily AND cron monthly, no problem. – Ian W Jul 09 '22 at 03:53

0 Answers0