mirror of
https://github.com/opdavies/build-configs.git
synced 2025-02-02 05:47:32 +00:00
Fix TTY
in run
files for Drupal projects
This commit is contained in:
parent
0d622d3121
commit
58e454b2c2
|
@ -1,5 +1,11 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2023-12-15
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Make `TTY` configurable in `run` files for Drupal projects.
|
||||||
|
|
||||||
## 2023-11-24
|
## 2023-11-24
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -5,6 +5,13 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o pipefail
|
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.
|
# Run automated tests as part of the Continuous Integration (CI) pipeline.
|
||||||
function ci:test {
|
function ci:test {
|
||||||
lint:dockerfile
|
lint:dockerfile
|
||||||
|
@ -116,7 +123,7 @@ function test:commit {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _exec {
|
function _exec {
|
||||||
docker compose exec -T "${@}"
|
docker compose exec ${TTY} "${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _run {
|
function _run {
|
||||||
|
@ -127,7 +134,7 @@ function _run {
|
||||||
--entrypoint "${command}" \
|
--entrypoint "${command}" \
|
||||||
--no-deps \
|
--no-deps \
|
||||||
--rm \
|
--rm \
|
||||||
-T \
|
${TTY} \
|
||||||
"${service}" "${@}"
|
"${service}" "${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue