Autoincrementer with git

I would like to use autoincrementer with git but I am not sure if it can do what I need.

I am following the git flow workflow so each new feature is developed on its own feature branch and my Team City build uses a wildcard branch specification. This allows me to have multiple branches building separatelt on the same Team City build. I would like autoincrementer to use the branch name, something like %autoinc.<branch name>%. I tried using the %teamcity.build.branch% but I cannot embed variables within variables.

Is there a way to do this or a simple way to extend the plugin to do this?

Thanks

3 comments
Comment actions Permalink

Hi Simon,

I believe you need to put the two variables together to create the format you need, for example: %autoinc%.%teamcity.build.branch%

Each variable is replaced separately and you will get what you need.

This will work fine for feature branches and others that are not the default one.
For the default branch, though, you will run into an issue because TeamCity writes <default> instead of the real branch name ( TW-23699 )

Thanks,
Caio Proiete

0
Comment actions Permalink

Thank you, I shall give this a try.

I do not intend using this on the default branch, primarily this is for release branches which will be merged into master upon release, I have set the default branch to be master for these builds and disabled the trigger for master changes. This may show pending changes though but I can deal with that.

0
Comment actions Permalink

Does not look like this will do what I want it to do :-(

Basically I want to be able to put something like %autoinc.%teamcity.build.branch%% which I want transtaled to %autoinc.ABC-1234% where ABC-1234 is a Jira id, the %autoinc.ABC-1234% is then translated by autoincrementer into an incrementing number. This will allow me to have a single build that can build sequential release candidates for each branch.

Looking at the code I think that what the plugin needs to do is add a further translation of %value% values with properties when parsing the autoinc variables.

0

Please sign in to leave a comment.