Skip to content

Commit

Permalink
Fix TTY in run files for Drupal projects
Browse files Browse the repository at this point in the history
  • Loading branch information
opdavies committed Dec 15, 2023
1 parent 0d622d3 commit 58e454b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2023-12-15

### Fixed

* Make `TTY` configurable in `run` files for Drupal projects.

## 2023-11-24

### Changed
Expand Down
11 changes: 9 additions & 2 deletions templates/drupal/run.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -116,7 +123,7 @@ function test:commit {
}

function _exec {
docker compose exec -T "${@}"
docker compose exec ${TTY} "${@}"
}

function _run {
Expand All @@ -127,7 +134,7 @@ function _run {
--entrypoint "${command}" \
--no-deps \
--rm \
-T \
${TTY} \
"${service}" "${@}"
}

Expand Down

0 comments on commit 58e454b

Please sign in to comment.