Mark Pearl

Setting a TeamCity Build Number from Console

To set a custom build number directly, specify a buildNumber message using the following format:

##teamcity[buildNumber '<new build number>']

In the value, you can use the {build.number} substitution to use the current build number automatically generated by TeamCity. For example...

##teamcity[buildNumber '1.2.3_{build.number}-ent']

Getting Command Line and TeamCity to pass values between each other

Write
echo "%build.number%" > \last-successful-build-version.txt

Writes the build number to a file in the build agent.

Read
$ver = get-content \last-successful-build-version.txt
write-host "##teamcity[setParameter name='version_to_deploy' value='${ver}']"

Reads the value from the written file back in to TeamCity parameters.

Great Visualizers

BuildReactor

References



blog comments powered by Disqus

Want to get my personal insights on what I learn as I learn it? Subscribe now!


/