diff options
| author | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-07-23 09:29:48 -0700 |
|---|---|---|
| committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-07-23 09:29:48 -0700 |
| commit | 2708fc955a46cacd93869903eaab4321bd274226 (patch) | |
| tree | cef2c2e540bec16520eca84e2c73624b7222bc79 /worker/scripts | |
| parent | 22694944ced5aa4ae61caee1adb4415bd285c6d6 (diff) | |
| download | ci-2708fc955a46cacd93869903eaab4321bd274226.tar.gz ci-2708fc955a46cacd93869903eaab4321bd274226.zip | |
Thread through commit hash
Diffstat (limited to 'worker/scripts')
| -rwxr-xr-x | worker/scripts/build_docker_image.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/worker/scripts/build_docker_image.ts b/worker/scripts/build_docker_image.ts index 527120a..414d612 100755 --- a/worker/scripts/build_docker_image.ts +++ b/worker/scripts/build_docker_image.ts @@ -21,6 +21,7 @@ const job = getRequiredEnvVars([ 'context', 'dockerfile', 'buildTarget', + 'commit', ]) .mapRight( (baseArgs) => @@ -128,9 +129,21 @@ function getDockerLoginCommand(username: string, registry: string): Command { } function getBuildCommand(args: BuildDockerImageJobProps): Command { - const { buildTarget, dockerfile, context } = args; + const { buildTarget, dockerfile, context, commit } = args; const tag = getImageTag(args); - return ['docker', 'build', '--target', buildTarget, '-t', tag, '-f', path.join(context, dockerfile), context]; + return [ + 'docker', + 'build', + '--target', + buildTarget, + '--build-arg', + `COMMIT=${commit}`, + '-t', + tag, + '-f', + path.join(context, dockerfile), + context, + ]; } function getImageTag({ registry, namespace, repository, imageTag }: BuildDockerImageJobProps) { |
