-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdayuenv.sh
executable file
·73 lines (67 loc) · 1.9 KB
/
dayuenv.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
64
65
66
67
68
69
70
71
72
73
#! /bin/sh
cd `dirname $0`
. ./command/color.sh
# 获取输入命令
cmd=$1
case $cmd in
"build" )
$OUTPUT "$RED Build the docker image and init container $TAILS\n"
./command/build.sh
exit
;;
"start" )
$OUTPUT "$RED Start the docker container $TAILS\n"
./command/start.sh
exit
;;
"restart" )
$OUTPUT "$RED Restart the docker container $TAILS\n"
./command/restart.sh
exit
;;
"login" )
$OUTPUT "$RED Into the docker container $TAILS\n"
./command/login.sh $2
exit
;;
"stop" )
$OUTPUT "$RED Stop the docker container $TAILS\n"
./command/stop.sh
exit
;;
"ls" )
$OUTPUT "$RED Show all the container $TAILS\n"
docker ps -a | grep dev-*
exit
;;
"getcode" )
$OUTPUT "$RED Update project code $TAILS\n"
codepath='../code'
./command/code.sh $codepath
exit
;;
"destroy" )
$OUTPUT "$RED Delete the docker container $TAILS\n"
./command/destroy.sh
exit
;;
* )
$OUTPUT "
$BLUE$FLICKER Building a development environment for yourself by docker $TAILS
$YELLOW Usage: $TAILS
$WHITE dayuenv $TAILS build/start/ls/restart/stop/getcode/login/destroy
$YELLOW Command: $TAILS
$WHITE dayuenv build $TAILS build image and init docker container
$WHITE dayuenv start $TAILS build or start container
$WHITE dayuenv ls $TAILS show container list
$WHITE dayuenv restart $TAILS restart container
$WHITE dayuenv stop $TAILS stop container
$WHITE dayuenv getcode $TAILS clone or pull project code from github, default code path: ../code
$WHITE dayuenv login $TAILS into the container, option: [php] [nginx] [redis] [redis-slave01] [mysql] [golang]
$WHITE dayuenv destroy $TAILS destroy container and delete the logs dir
$WHITE dayuenv help $TAILS commands list
$GREEN GitHub: $BTLINE https://github.com/helei112g$TAILS
"
exit
;;
esac