diff --git a/CHANGELOG.md b/CHANGELOG.md index 7099d85..a312622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2023-12-15 + +### Fixed + +* Make `TTY` configurable in `run` files for Drupal projects. + ## 2023-11-24 ### Changed diff --git a/templates/drupal/run.twig b/templates/drupal/run.twig index 7e3c922..0e616ed 100755 --- a/templates/drupal/run.twig +++ b/templates/drupal/run.twig @@ -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 @@ -116,7 +123,7 @@ function test:commit { } function _exec { - docker compose exec -T "${@}" + docker compose exec ${TTY} "${@}" } function _run { @@ -127,7 +134,7 @@ function _run { --entrypoint "${command}" \ --no-deps \ --rm \ - -T \ + ${TTY} \ "${service}" "${@}" }