Jenkins CI: How to trigger builds on SVN commit

前端 未结 4 1471
误落风尘
误落风尘 2020-12-02 06:16

What plugins and plugin features do I need to set in order to get my Jenkins job to trigger a build any time code is committed to an SVN project?

I have installed bo

4条回答
  •  眼角桃花
    2020-12-02 07:03

    You need to require only one plugin which is the Subversion plugin.

    Then simply, go into Jenkins → job_name → Build Trigger section → (i) Trigger build remotely (i.e., from scripts) Authentication token: Token_name

    Go to the SVN server's hooks directory, and then after fire the below commands:

    1. cp post-commit.tmpl post-commit
    2. chmod 777 post-commit
    3. chown -R www-data:www-data post-commit
    4. vi post-commit

      Note: All lines should be commented Add the below line at last

    Syntax (for Linux users):

    /usr/bin/curl http://username:API_token@localhost:8081/job/job_name/build?token=Token_name
    

    Syntax (for Windows user):

    C:/curl_for_win/curl http://username:API_token@localhost:8081/job/job_name/build?token=Token_name
    

提交回复
热议问题