Set Build Number
  • 14 May 2021
  • 1 Minute to read
  • Dark
  • PDF

Set Build Number

  • Dark
  • PDF

This is generated from the built in components of BuildMaster 7.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.

Set Build Number

Sets (changes) the build number of the currently executing build.

Script usage:

Set-BuildNumber <text>;

This operation may be prefixed with Core::, although this is a built-in namespace and isn't really necessary.


NameFormatScript UsageUsage Notes
New build number (default)
This argument is required.

Build Number in Context: This operation will do two things: change the BuildNumber in the database and create a runtime variable named $BuildNumber with the new build number. However, it will *not* update the execution context with the new BuildNumber; this means that, for some operations that rely on the BuildNumber in context (instead of looking up the BuildNumber based on the BuildId), this will likely result in a "build not found" or such error. To resolve this, explicitly pass in $BuildNumber as an argument. For example, if you create an artifact after setting the BuildNumber, explicitly pass in the BuildNumber.


# The build.xml file contains a project version we wish to show users in the build number
PSCall GLOBAL::ExtractProjectVersion
    buildFilePath: $WorkingDirectory\build.xml,
    OutputArg => $ProjectVersionTemp

# This will update the build number
Set-BuildNumber $ExtractProjectVersion.$BuildNumber;

Was this article helpful?