diff --git a/hooks/pre-command b/hooks/pre-command new file mode 100644 index 00000000..895a9404 --- /dev/null +++ b/hooks/pre-command @@ -0,0 +1,6 @@ +#!/bin/bash +set -ueo pipefail + +# If they're using Buildkit, make sure it doesn't output the '---' lines that +# mess up Buildkite's log output grouping +export BUILDKIT_PROGRESS=plain \ No newline at end of file diff --git a/tests/pre-command.bats b/tests/pre-command.bats new file mode 100644 index 00000000..fd65438a --- /dev/null +++ b/tests/pre-command.bats @@ -0,0 +1,13 @@ +#!/usr/bin/env bats + +load '/usr/local/lib/bats/load.bash' + +@test "Pre-command sets Buildkit to use plain output" { + BUILDKIT_PROGRESS= + + source "$PWD/hooks/pre-command" + + assert_equal "plain" "${BUILDKIT_PROGRESS}" + + unset BUILDKIT_PROGRESS +}