Skip to content

Commit

Permalink
Set build --progress to plain (#53)
Browse files Browse the repository at this point in the history
This will make it easier to review build information in the Buildkite UI
as lines won't be hidden by escape codes, and prevents TTY progress from
clogging up exported build logs.
  • Loading branch information
72636c authored Nov 3, 2024
1 parent e85ca06 commit 6517649
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ else
image_build_args=(
"build"
"--file=${docker_file}"
"--progress=plain"
"--tag=${image}:${tag}"
)
if [[ -n "${target:-}" ]]; then
Expand Down
8 changes: 4 additions & 4 deletions tests/ecr-registry-provider.bats
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pre_command_hook="$PWD/hooks/pre-command"
stub docker \
"login --username AWS --password-stdin 1234567891012.dkr.ecr.ap-southeast-2.amazonaws.com : echo logging in to docker" \
"pull 1234567891012.dkr.ecr.ap-southeast-2.amazonaws.com/build-cache/example-org/example-pipeline:deadbee : echo not found && false" \
"build --file=Dockerfile --tag=1234567891012.dkr.ecr.ap-southeast-2.amazonaws.com/build-cache/example-org/example-pipeline:deadbee . : echo building docker image" \
"build --file=Dockerfile --progress=plain --tag=1234567891012.dkr.ecr.ap-southeast-2.amazonaws.com/build-cache/example-org/example-pipeline:deadbee . : echo building docker image" \
"tag ${repository_uri}:deadbee ${repository_uri}:latest : echo tagged latest" \
"push ${repository_uri}:deadbee : echo pushed deadbee" \
"push ${repository_uri}:latest : echo pushed latest"
Expand Down Expand Up @@ -113,7 +113,7 @@ pre_command_hook="$PWD/hooks/pre-command"
stub docker \
"login --username AWS --password-stdin 1234567891012.dkr.ecr.eu-west-1.amazonaws.com : echo logging in to docker" \
"pull 1234567891012.dkr.ecr.eu-west-1.amazonaws.com/build-cache/example-org/example-pipeline:deadbee : echo not found && false" \
"build --file=Dockerfile --tag=1234567891012.dkr.ecr.eu-west-1.amazonaws.com/build-cache/example-org/example-pipeline:deadbee . : echo building docker image" \
"build --file=Dockerfile --progress=plain --tag=1234567891012.dkr.ecr.eu-west-1.amazonaws.com/build-cache/example-org/example-pipeline:deadbee . : echo building docker image" \
"tag ${repository_uri}:deadbee ${repository_uri}:latest : echo tagged latest" \
"push ${repository_uri}:deadbee : echo pushed deadbee" \
"push ${repository_uri}:latest : echo pushed latest"
Expand Down Expand Up @@ -161,7 +161,7 @@ pre_command_hook="$PWD/hooks/pre-command"
stub docker \
"login --username AWS --password-stdin 1234567891012.dkr.ecr.ap-southeast-1.amazonaws.com : echo logging in to docker" \
"pull 1234567891012.dkr.ecr.ap-southeast-1.amazonaws.com/build-cache/example-org/example-pipeline:deadbee : echo not found && false" \
"build --file=Dockerfile --tag=1234567891012.dkr.ecr.ap-southeast-1.amazonaws.com/build-cache/example-org/example-pipeline:deadbee . : echo building docker image" \
"build --file=Dockerfile --progress=plain --tag=1234567891012.dkr.ecr.ap-southeast-1.amazonaws.com/build-cache/example-org/example-pipeline:deadbee . : echo building docker image" \
"tag ${repository_uri}:deadbee ${repository_uri}:latest : echo tagged latest" \
"push ${repository_uri}:deadbee : echo pushed deadbee" \
"push ${repository_uri}:latest : echo pushed latest"
Expand Down Expand Up @@ -226,4 +226,4 @@ pre_command_hook="$PWD/hooks/pre-command"
unstub aws
unstub docker
unstub sha1sum
}
}
6 changes: 3 additions & 3 deletions tests/pre-command.bats
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pre_command_hook="$PWD/hooks/pre-command"

stub docker \
"pull pretend.host/path/segment/image:stubbed-computed-tag : false" \
"build --file=Dockerfile --tag=pretend.host/path/segment/image:stubbed-computed-tag . : exit 242"
"build --file=Dockerfile --progress=plain --tag=pretend.host/path/segment/image:stubbed-computed-tag . : exit 242"

run "${pre_command_hook}"

Expand All @@ -53,7 +53,7 @@ pre_command_hook="$PWD/hooks/pre-command"

stub docker \
"pull pretend.host/path/segment/image:stubbed-computed-tag : false" \
"build --file=Dockerfile --tag=pretend.host/path/segment/image:stubbed-computed-tag . : echo building docker image" \
"build --file=Dockerfile --progress=plain --tag=pretend.host/path/segment/image:stubbed-computed-tag . : echo building docker image" \
"tag ${repository_uri}:stubbed-computed-tag ${repository_uri}:latest : echo tagged latest" \
"push ${repository_uri}:stubbed-computed-tag : echo pushed stubbed-computed-tag" \
"push ${repository_uri}:latest : echo pushed latest"
Expand All @@ -80,7 +80,7 @@ pre_command_hook="$PWD/hooks/pre-command"

stub docker \
"pull pretend.host/path/segment/image:stubbed-computed-tag : false" \
"build --file=$one_time_mktemp/Dockerfile --tag=pretend.host/path/segment/image:stubbed-computed-tag . : echo building docker image" \
"build --file=$one_time_mktemp/Dockerfile --progress=plain --tag=pretend.host/path/segment/image:stubbed-computed-tag . : echo building docker image" \
"tag ${repository_uri}:stubbed-computed-tag ${repository_uri}:latest : echo tagged latest" \
"push ${repository_uri}:stubbed-computed-tag : echo pushed stubbed-computed-tag" \
"push ${repository_uri}:latest : echo pushed latest"
Expand Down

0 comments on commit 6517649

Please sign in to comment.