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"
|
TTY="-T"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DC="${DC:-exec}"
|
||||||
|
|
||||||
function cmd {
|
function cmd {
|
||||||
# Run any command in the app container.
|
# Run any command in the app container.
|
||||||
_dc app "${@}"
|
_dc app "${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function composer {
|
||||||
|
DC=run
|
||||||
|
_dc --entrypoint composer app "${@}"
|
||||||
|
}
|
||||||
|
|
||||||
function deploy {
|
function deploy {
|
||||||
cd tools/deployment && ansible-playbook deploy.yml
|
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
|
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 {
|
function _dc {
|
||||||
docker-compose exec ${TTY} "${@}"
|
docker-compose ${DC} ${TTY} "${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
eval "${@:-help}"
|
eval "${@:-help}"
|
||||||
|
|
Loading…
Reference in a new issue