Why did my TeamCity build stop working?
teamcity.build.branch
is a predefined build parameter but it is only defined when a branch specification is configured. Therefore, to fix your problem, make sure that your build step has a VCS root configured and add e.g. +:refs/heads/(master)
as your branch specification.
From TeamCity's documentation on Agent Requirements and implicit requirements:
Any reference (name in %-signs) to an unknown parameter is considered an "implicit requirement". That means that the build will only run on the agent which provides the parameters named.
Otherwise, the parameter should be made available for the build configuration by defining it on the build configuration or project levels.