File tree Expand file tree Collapse file tree 2 files changed +45
-51
lines changed Expand file tree Collapse file tree 2 files changed +45
-51
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ dirname=${PWD##*/ } # Get the current dir name, without full path
6+ dirname=${dirname:-/ } # to correct for the case where PWD is / (root)
7+ dirname=` echo $dirname | tr ' [:upper:]' ' [:lower:]' ` # Convert the dirname to lowercase.
8+
9+ project=${dirname}
10+ appContainer=" php-fpm"
11+
12+ function build {
13+ docker compose build
14+ }
15+
16+ function start {
17+ docker compose up -d
18+ }
19+
20+ function stop {
21+ docker compose down
22+ }
23+
24+ function restart {
25+ stop
26+ start
27+ }
28+
29+ function shell {
30+ start
31+ docker exec -it $( docker ps -q --filter=" NAME=${project} -${appContainer} " ) bash
32+ }
33+
34+ function default {
35+ start
36+ }
37+
38+ function help {
39+ echo " $0 <task> <args>"
40+ echo " Tasks:"
41+ compgen -A function | cat -n
42+ }
43+
44+ TIMEFORMAT=" Task completed in %3lR"
45+ time ${@:- default}
You can’t perform that action at this time.
0 commit comments