Can Hudson be configured to build every revision?

前端 未结 5 1465
终归单人心
终归单人心 2021-02-06 07:45

I\'ve started experimenting with Hudson as a build server. I\'m using subversion and have it configured to poll every minute. The issue I\'m seeing is that if a build at revisio

5条回答
  •  名媛妹妹
    2021-02-06 08:21

    You have to do a few things to build exactly each revision:

    • add a REVISION string parameter to your job
    • append the ${REVISION} parameter to the repository URL,
      e.g.: https://server/path/myproject${REVISION}
    • set the name of the local folder to 'myproject' (see previous example), because the REVISION variable is only expanded in the URL, but when creating the folder, Hudson will not expand it, resulting in a folder named: myproject${REVISION}
    • trigger the parameterized build from the post-commit hook, like that: /usr/bin/wget \ --auth-no-challenge \ --no-check-certificate \ --user=me \ --password=mypasswd \ https: //server/path/job/jobname/buildWithParameters?delay=0sec\&REVISION=%40$REV \ -O /dev/null

    If you want to trigger a build manually, you have two possibilities:

    • if you want to build HEAD revision, you must leave the REVISION parameter empty
    • if you want to build a specific revision, you have to enter @NNN (eg: @1234).

    The @ sign is very important because all this trick relies on the fact that Subversion plugin interprets URL@NNN as get revision NNN from repository at URL. If you forget the @, Subversion will just say it can't find folder https://server/path/myprojectNNN. That's also why you have to put %40 between REVISION= and $REV in the wget command, %40 is the escaped character for @.

提交回复
热议问题