简体   繁体   中英

can Jenkins detect everytime any svn-user commit the code?

can Jenkins detect everytime any svn-user commit the code? I want to know everytime the svn-user commit by Jenkins, is there any way or jenkins plugin? now I use svn update cmd in Jenkins to update svn.

You can follow either of following approaches to get what you want

  1. Poll SVN for changes from Jenkins
  2. Configure SVN (using post commit hook) to trigger a build on Jenkins

For polling, go to job properties -> "Build Triggers" heading and select "Poll SCM Schedule". You can specify how often do you want SVN to poll the repository. You can keep this value as low as 1 minute.

For SVN post commit hook, take a look at Subversion Plugin Documentation . This is explained in detail in "Post-commit hook" section. Please read through this section carefully as it explains all the options including what/when to include which svn information in jenkins REST call from the trigger script.

If you build is dependent on multiple repositories (say every solution is in repository of it's own) then SVN post commit is the best option since you'll be able to trigger a single job from all the repository post commit by providing/tweaking parameters in the post commit hook script.

On a side note, I can understand why someone downvoted your question. I'll strongly recommend you to add full information in your questions and show that you have done the research yourself before posting a question. A quick google on "jenkins trigger build on svn commit" lead me to this stackoverflow question as the first result which precisely explains what you are trying to do. The question (and it's answers) are very old (asked 8 years back, active till last year) but every bit of information is still very helpful for this question. " How do I ask a good question " from stackoverflow help section further explains what does stackoverflow community expects in general in every question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM