Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
315 views
in Technique[技术] by (71.8m points)

windows - 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...