.bset

.bset env "<VarName>=<Value>" [...]
.bset selector <SelectorName>
.bset server <ServerName>
.bset buildserver <ServerName>

During a job, the .bset command changes project settings temporarily.

Note: The .bset command affects the base build environment for later steps that use that environment. Do not specify a .bset command that relies on a previous .bset command in the same step. For example, do not specify steps similar to the following combination in the same step.
.bset env "VAR1=VALUE1"
.bset env "VAR2=$VAR1"

The command has the following options:

  • env changes the value of one or more project environment variables for a running job. The change takes effect immediately in the current step. For more information about using the command this way, see Changing the build tag during a job. You can set a variable that does not yet exist. Values set by the .bset command are written to the job record. If you set a new value for a variable that is also defined in a project or step environment, the new value is in effect only during the job. The environment for the project or step is not changed.
  • selector changes the project selector during a job. The new selector takes effect in the next step, which can include any inline steps for the current step. The new selector is used only for steps that do not have an explicit selector setting. The selector for the step is set to Project Default. If you use the selector option in an inline step, the option affects all subsequent steps in the inlined project, including any steps that the inline step inlines. It does not affect the calling step or any other steps at or above the level of the calling step.

    Steps that have an explicit selector set are not affected.

  • server changes the default project server during a job. The new server setting takes effect in the next step, which does not include any inline steps. Steps use the specified server only; they do not have an explicit selector setting.
    Backtick syntax: you can use backticks to set the server name to the output of a command. For example, the following command runs the SelectAServer.sh script and provides its output as the server name for the .bset server command:
    .bset server `SelectAServer.sh`
    Note: If you use .bset with backtick and the target script output with a non-zero exit code, MJC reports the error message, Exception communicating with endpoint server.
  • buildserver changes the default project server during a job. The new server setting takes effect in the next step, which includes any inline steps. The setting also takes effect in the next loop when .bset is applied in a loop scenario. It differs from the server option because it applies to inlined steps, next loop steps, and project-level steps.
Note: For Perl engines, .bset server and buildserver do not affect inline steps.
Important: Avoid using multiple .bset commands in threaded steps.