(
ctx: BuildStepGlobalContext,
{
id,
displayName,
inputs,
outputs,
command,
fn,
workingDirectory: maybeWorkingDirectory,
shell,
supportedRuntimePlatforms: maybeSupportedRuntimePlatforms,
env,
ifCondition,
timeoutMs,
__metricsId,
}: {
id: string;
displayName: string;
inputs?: BuildStepInput[];
outputs?: BuildStepOutput[];
command?: string;
fn?: BuildStepFunction;
workingDirectory?: string;
shell?: string;
supportedRuntimePlatforms?: BuildRuntimePlatform[];
env?: BuildStepEnv;
ifCondition?: string;
timeoutMs?: number;
__metricsId?: string;
}
)
| 147 | } |
| 148 | |
| 149 | constructor( |
| 150 | ctx: BuildStepGlobalContext, |
| 151 | { |
| 152 | id, |
| 153 | displayName, |
| 154 | inputs, |
| 155 | outputs, |
| 156 | command, |
| 157 | fn, |
| 158 | workingDirectory: maybeWorkingDirectory, |
| 159 | shell, |
| 160 | supportedRuntimePlatforms: maybeSupportedRuntimePlatforms, |
| 161 | env, |
| 162 | ifCondition, |
| 163 | timeoutMs, |
| 164 | __metricsId, |
| 165 | }: { |
| 166 | id: string; |
| 167 | displayName: string; |
| 168 | inputs?: BuildStepInput[]; |
| 169 | outputs?: BuildStepOutput[]; |
| 170 | command?: string; |
| 171 | fn?: BuildStepFunction; |
| 172 | workingDirectory?: string; |
| 173 | shell?: string; |
| 174 | supportedRuntimePlatforms?: BuildRuntimePlatform[]; |
| 175 | env?: BuildStepEnv; |
| 176 | ifCondition?: string; |
| 177 | timeoutMs?: number; |
| 178 | __metricsId?: string; |
| 179 | } |
| 180 | ) { |
| 181 | assert(command !== undefined || fn !== undefined, 'Either command or fn must be defined.'); |
| 182 | assert(!(command !== undefined && fn !== undefined), 'Command and fn cannot be both set.'); |
| 183 | const outputById = makeBuildStepOutputByIdMap(outputs); |
| 184 | super(id, displayName, false, outputById); |
| 185 | |
| 186 | this.id = id; |
| 187 | this.displayName = displayName; |
| 188 | this.supportedRuntimePlatforms = maybeSupportedRuntimePlatforms; |
| 189 | this.inputs = inputs; |
| 190 | this.inputById = makeBuildStepInputByIdMap(inputs); |
| 191 | this.outputById = outputById; |
| 192 | this.fn = fn; |
| 193 | this.command = command; |
| 194 | this.shell = shell ?? '/bin/bash -eo pipefail'; |
| 195 | this.ifCondition = ifCondition; |
| 196 | this.timeoutMs = timeoutMs; |
| 197 | this.__metricsId = __metricsId; |
| 198 | this.status = BuildStepStatus.NEW; |
| 199 | |
| 200 | const logger = ctx.baseLogger.child({ |
| 201 | buildStepId: this.id, |
| 202 | buildStepDisplayName: this.displayName, |
| 203 | }); |
| 204 | this.ctx = ctx.stepCtx({ logger, relativeWorkingDirectory: maybeWorkingDirectory }); |
| 205 | this.stepEnvOverrides = env ?? {}; |
| 206 |
nothing calls this directly
no test coverage detected