More precisely, we needed a valid version identifier to be built in two different scenarios:
- Release builds: take the release tag from Git (i.e. "v188.8.131.52"), skip the "v" prefix and return the rest as the version ID.
- QA builds: we do not tag each QA build, so we need to take into account the last tag and the number of commits ahead that, then merge them into something like "184.108.40.206" meaning "5 commits ahead of release 220.127.116.11". Why 105 and not 5? Well, we are reserving a block of numbers (18.104.22.168 - 22.214.171.124) to accommodate eventual production fixes on a dedicated release branch.
Enter Git tag labeller plugin for CCNet - we built a plugin to be used as a
block in a CCNet configuration script and posted it on GitHub, you can find it here.
Besides the functionality we needed, we added a couple of features some one else may use, like a simple concatenation of the existing git tag with the commits ahead count; i.e. "ReleaseCandidate.6".
See the GitHub project for the most up-to-date documentation and code.