mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-23 00:05:09 +00:00
add auto start of containers to dbench script
This commit is contained in:
parent
2543e54bf7
commit
38e07097d1
1 changed files with 10 additions and 0 deletions
10
dbench
10
dbench
|
|
@ -8,7 +8,16 @@ display_usage() {
|
|||
echo ' -c execute a command inside docker using docker exec'
|
||||
}
|
||||
|
||||
# start docker containers if they are not running (check for frappe)
|
||||
launch_containers() {
|
||||
docker exec frappe /bin/true 2>/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
docker-compose up -d
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
launch_containers
|
||||
docker exec -it frappe bash
|
||||
else
|
||||
while getopts ':hc:' option; do
|
||||
|
|
@ -18,6 +27,7 @@ else
|
|||
exit
|
||||
;;
|
||||
c)
|
||||
launch_containers
|
||||
docker exec frappe bash -c "bench $OPTARG"
|
||||
;;
|
||||
\?)
|
||||
|
|
|
|||
Loading…
Reference in a new issue