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

Set Build Number

  • Dark
    Light
  • PDF

Article Summary

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.

Arguments:

NameFormatScript UsageUsage Notes
New build number (default)
text
BuildNumber
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.

Example:

# 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?