-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-controller.sh
executable file
·63 lines (56 loc) · 1.1 KB
/
docker-controller.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
TMP_PROJECT=tmp_luigipetronzo
FILE_CONFIG='.bitbucket'
function error {
echo "Options not passed"
helper
}
function helper {
echo
echo "NAME"
echo -e "\tdocker-controller -- build a docker environment LAMP"
echo
echo "SYNOPSIS"
echo -e "\tbuild [start|stop|help]"
echo
echo "DESCRIPTION"
echo -e "\tThe following options are available:"
echo
echo -e "\tstart\tCreate three docker container (web server, php-fpm and database) and orchestrate their"
echo
echo -e "\tstop\tStop the environment previously created"
echo
echo -e "\thelp\tDisplay this help menu"
echo
}
function start {
docker-compose up
}
function stop {
docker-compose stop
}
if [[ $# -eq 0 ]]; then
error
fi
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
start)
start
shift
;;
stop)
stop
shift
;;
help)
helper
exit
;;
*)
error
exit
;;
esac
shift # past argument or value
done