From a7d4bdd8d7ecec691b82af4658dd4c4889092fd4 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 16 Dec 2023 09:02:55 +0000 Subject: [PATCH] Update build configuration files --- run | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/run b/run index b209933..bb43b7e 100755 --- a/run +++ b/run @@ -5,6 +5,13 @@ set -o errexit set -o pipefail +# If we're running in CI we need to disable TTY allocation for docker compose +# commands that enable it by default, such as exec and run. +TTY="${TTY:-}" +if [[ ! -t 1 ]]; then + TTY="-T" +fi + # Run automated tests as part of the Continuous Integration (CI) pipeline. function ci:test { lint:dockerfile @@ -80,7 +87,7 @@ function test:commit { } function _exec { - docker compose exec -T "${@}" + docker compose exec ${TTY} "${@}" } function _run { @@ -91,7 +98,7 @@ function _run { --entrypoint "${command}" \ --no-deps \ --rm \ - -T \ + ${TTY} \ "${service}" "${@}" }