0

I am polling Accurev SCM after every 30 minutes using Poll SCM as H/30 * * * *

However, I want to change the functionality so that Accurev is polled by Jenkins only after there are changes in code in Accurev. I don't want to keep polling Accurev SCM after every 30 minutes

Please let me know how that can be achieved.

6
  • You do realize that the SCM polling is how Jenkins knows your repository changed? You're effectively asking if there is a way to only check if a change happened once you know for sure that a change has occurred. If you could do this why poll at all, just start the job.
    – Tuffwer
    Commented Mar 3, 2016 at 21:22
  • Actually, I want to start the job everytime a change occurs.
    – meallhour
    Commented Mar 3, 2016 at 21:40
  • Are you using this plugin AccuRev Plugin? If so the simple answer would be to poll with a much much shorter frequency than you are. After some quick reading on that plugin I don't think that functionality exists currently. It hasn't been updated since 2014. You might be able to fork it on Git and write your own method that allows a trigger on SCM change. That would probably involve setting up something that pushes a notification to the plugin though.
    – Tuffwer
    Commented Mar 3, 2016 at 22:02
  • Yes, I am using AccuRev plugin. Can you throw some light on how to fork it on Git and write your own method that allows a trigger on SCM change. That would probably involve setting up something that pushes a notification to the plugin though
    – meallhour
    Commented Mar 3, 2016 at 22:06
  • Not much really, I'm not particularly familiar with Java (you'd need to write some code to do this) and this could be a terrible approach, but: Here is the git repo You'll want to do a pull request to get the source code of the plugin and then add a method that listens (perhaps with TCP/IP?) for some sort of notification and starts the job. You'll then have to see if the AccuRev repo can send a notification. If it can you'll want to figure out it's structure and write your method in the plugin to parse that notification correctly. 1/2
    – Tuffwer
    Commented Mar 3, 2016 at 22:12

1 Answer 1

2

You can use AccuRev triggers to call the build of your Jenkins job. If you set a server-side trigger, like server-post-promote-trig (documentation), AccuRev will execute a task every time a change is promoted to a certain stream.

The only thing you need to code in that trigger will be a call to http://your_jenkins_server/job/your_job/build and Jenkins will execute the job immediately, so you don't need to select any checkbox under the "Build Triggers" section.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.