-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
50 lines (45 loc) · 1.03 KB
/
release.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
#!/bin/sh
sync(){
cmd="cd /data/www/private_deploy/jobs ; git fetch --all ; git reset --hard origin/master"
echo "\033[32m"$cmd
eval $cmd
DATE=`date +%Y%m%d%H%M%S`
echo $DATE > /data/www/release_version/python3_jobs
return 0
}
reload() {
cmd="export ops_config='production' && /data/www/vir_python3/bin/uwsgi --reload /data/www/logs/jobs/app.pid"
echo "\033[32m"$cmd
eval $cmd
return 0
}
stop() {
cmd="export ops_config='production' && /data/www/vir_python3/bin/uwsgi --stop /data/www/logs/jobs/app.pid"
echo "\033[32m"$cmd
eval $cmd
return 0
}
start() {
cmd="export ops_config='production' && /data/www/vir_python3/bin/uwsgi --ini /data/www/private_deploy/jobs/uwsgi.ini"
echo "\033[32m"$cmd
eval $cmd
return 0
}
case "$1" in
sync)
sync
;;
start)
start
;;
stop)
stop
;;
reload)
reload
;;
*)
echo "Usage: sh release.sh {sync|start|stop|reload}" >&2
exit 3
;;
esac