BuildForge Help

.bset

.bset env "<VariableName>=<DesiredValue>" ["<VariableName>=<DesiredValue>"]
.bset selector <SelectorName>
.bset server <ServerName>
.bset buildserver <ServerName>

The .bset command changes project settings temporarily during a job. The command has several options:

The .bset selector -p option changes the selector for steps in the currently executing project, and any subsequent inlines that the steps call. It is commonly used in inlined projects when the intent is to change the selector for this project and its steps and descendants (other inlines), but not the project that called the currently executing project.

For example:

JOB
  Step A
        Inline AA
        Step B
               Inline BB
               Step C
  Step D
        Inline DD
        Step E
 

If Step B is .bset selector, it will change the default selector for JOB. If Step B is .bset selector -p, it will just change the default selector for Inline A and its children (Inline BB and Step C). Step D/E will still use the original default selector.

The .bset changes do not take effect until the current step completes. For example, if your step includes multiple commands as in the following example, the second line operates in an environment unmodified by the .bset command:
.bset env "CompilerVersion=1.1"
compile driverset 

When the second line executes, the CompilerVersion value has not been set. To remedy this, move the compile command to the following step.

You can use backtick syntax to set the server name to the output of a command. For example, the command
.bset server `SelectAServer.sh`
runs the SelectAServer.sh script and provides its output as the server name for the .bset server command.
Note: Using multiple .bset commands in threaded steps is not recommended, in order to avoid race conditions when attempting to set the same variable, server, or selector. Instead, use .bset selector -p.