Fix TTY in run files for Drupal projects

This commit is contained in:
Oliver Davies 2023-12-15 13:28:55 +00:00
parent 0d622d3121
commit 58e454b2c2
2 changed files with 15 additions and 2 deletions

View file

@ -1,5 +1,11 @@
# Changelog
## 2023-12-15
### Fixed
* Make `TTY` configurable in `run` files for Drupal projects.
## 2023-11-24
### Changed

View file

@ -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}" "${@}"
}