build(run): add composer and test commands
This commit is contained in:
parent
d3175dc980
commit
fe6b6d13d8
24
run
24
run
|
@ -11,11 +11,18 @@ if [[ ! -t 1 ]]; then
|
|||
TTY="-T"
|
||||
fi
|
||||
|
||||
DC="${DC:-exec}"
|
||||
|
||||
function cmd {
|
||||
# Run any command in the app container.
|
||||
_dc app "${@}"
|
||||
}
|
||||
|
||||
function composer {
|
||||
DC=run
|
||||
_dc --entrypoint composer app "${@}"
|
||||
}
|
||||
|
||||
function deploy {
|
||||
cd tools/deployment && ansible-playbook deploy.yml
|
||||
}
|
||||
|
@ -45,8 +52,23 @@ function run-production {
|
|||
docker-compose --file docker-compose-production.yaml up --detach --remove-orphans
|
||||
}
|
||||
|
||||
function sh {
|
||||
DC=run
|
||||
_dc --entrypoint sh app
|
||||
}
|
||||
|
||||
function test:quality {
|
||||
DC=run
|
||||
_dc --entrypoint phpstan app "${@}" analyze --memory-limit=-1
|
||||
}
|
||||
|
||||
function test:unit {
|
||||
DC=run
|
||||
_dc --entrypoint phpunit app "${@}"
|
||||
}
|
||||
|
||||
function _dc {
|
||||
docker-compose exec ${TTY} "${@}"
|
||||
docker-compose ${DC} ${TTY} "${@}"
|
||||
}
|
||||
|
||||
eval "${@:-help}"
|
||||
|
|
Loading…
Reference in a new issue