Hudson: how do i use a parameterized build to do svn checkout and svn tag?

Posted by Derick Bailey on Stack Overflow See other posts from Stack Overflow or by Derick Bailey
Published on 2010-06-17T14:31:11Z Indexed on 2010/06/17 14:33 UTC
Read the original article Hit count: 415

Filed under:
|
|
|
|

I'm setting up a parameterized build in hudson v1.362. the parameter i'm creting is used to determine which branch to checkout in subversion.

I can set my svn repository url like this: https://my.svn.server/branches/${branch} and it does the checkout and the build just fine.

now I want to tag the build after it finishes. i'm using the SVN tagging plugin for hudson to do this. so i go to the bottom of the project config screen for the hudson project and turn on "Perform Subversion tagging on successful build".

here, i set my Tag Base URL to https://my.svn.server/tags/${branch}-${BUILD_NUMBER} and it gives me errors about those properties not being found. so i change them to environment variable usages like this: https://my.svn.server/tags/${env['branch']}-${env['BUILD_NUMBER']} and the svn tagging plugin is happy.

the problem now is that my svn repository at the top is using the ${branch} syntax and the svn tagging plugin barfs on this:

moduleLocation: Remote ->https://my.svn.server/branches/$branch/
Tag Base URL: 'https://my.svn.server/tags/thebranchiused-1234'.
There was no old tag at https://my.svn.server/tags/thebranchiused-1234.
ERROR: Publisher hudson.plugins.svn_tag.SvnTagPublisher aborted due to exception
java.lang.NullPointerException
    at hudson.plugins.svn_tag.SvnTagPlugin.perform(SvnTagPlugin.java:180)
    at hudson.plugins.svn_tag.SvnTagPublisher.perform(SvnTagPublisher.java:79)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
    at hudson.model.Build$RunnerImpl.cleanUp(Build.java:167)
    at hudson.model.Run.run(Run.java:1295)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:124)
Finished: FAILURE

notice the first line, there: the svn tag is looking at ${branch} as part of the repository url... it's not parsing out the property value.

i tried to change my original Repository URL for svn to use the ${env['branch']} syntax, but that blows up on the original checkout because this syntax is not getting parsed at all by the checkout.

help?!

how do i use a parameterized build to set the svn url for checkout and for tagging my build?!

© Stack Overflow or respective owner

Related posts about svn

Related posts about build