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

后端 未结 1 1164
-上瘾入骨i
-上瘾入骨i 2021-01-29 11:14

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 updat

相关标签:
1条回答
  • 2021-01-29 11:39

    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.

    0 讨论(0)
提交回复
热议问题