magnayn / Hudson-GIT-plugin

Git plugin for Hudson
http://wiki.hudson-ci.org/display/HUDSON/Git+Plugin
51 stars 26 forks source link

Support parameterized branch names #7

Closed ghost closed 14 years ago

ghost commented 14 years ago

Hi there,

I think we have a fairly common project setup here at our site: A quick (dist-)build task and a long running test task. In order to ensure that dist- and test-builds use the same version of the source code I tried to use lightweight git-tags to enforce this coupling.

In my dist-build I create a git tag (where the dist-build is parametrized as well)

"hudson/${JOB_NAME}/${buildconfiguration}/build${BUILD_NUMBER}"

and I also pass the name of the tag to the downstream project "test-build" (using the "Trigger parameterized build on other projects"-plugin): Parameters: git.tag=hudson/${JOB_NAME}/${buildconfiguration}/build${BUILD_NUMBER}

In my test-build I then defined a parameter "git.tag" and tried to use the parameter in the "Branches to build" configuration option.

Unfortunately the variable is not resolved but passed as-is to git: [workspace] $ /usr/bin/git rev-parse origin/${git.tag}

Is there a possibility to implement a configuration option that resolves parameters before handing them to git?

Jens

ghost commented 14 years ago

Ok. Found it. By naming the parameter _gittag instead of -git.tag- it worked. <:-(

By the way: thanks for this plugin!