-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_deploy.sh
executable file
·73 lines (61 loc) · 2 KB
/
prepare_deploy.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/bash
#
#
# Description : Prepare deploy packages for odin application.
# Author : vassilux
#
set -e
DEPLOY_DIR="odin"
VER_MAJOR="1"
VER_MINOR="0"
VER_PATCH="2"
if [ -d "$DEPLOY_DIR" ]; then
rm -rf "$DEPLOY_DIR"
fi
#
mkdir "$DEPLOY_DIR"
#
mkdir "$DEPLOY_DIR/client"
cp -aR client/app "$DEPLOY_DIR/client"
cp -aR install "$DEPLOY_DIR"
cp -aR pyodin "$DEPLOY_DIR"
cp -aR server "$DEPLOY_DIR"
rm -rf "$DEPLOY_DIR/pyodin/logs/odin_ami.log"
rm -rf "$DEPLOY_DIR/pyodin/logs/odin_callcenter.log"
rm -rf "$DEPLOY_DIR/pyodin/logs/odin_f1com.log"
rm -rf "$DEPLOY_DIR/pyodin/logs/odin_incall.log"
rm -rf "$DEPLOY_DIR/pyodin/logs/odin_monitor.log"
rm -rf "$DEPLOY_DIR/pyodin/logs/odin_sys.log"
rm -rf "$DEPLOY_DIR/pyodin/conf/odinami.conf"
rm -rf "$DEPLOY_DIR/pyodin/conf/odinamilogger.conf"
rm -rf "$DEPLOY_DIR/pyodin/conf/odinf1com.conf"
rm -rf "$DEPLOY_DIR/pyodin/conf/odinincall.conf"
rm -rf "$DEPLOY_DIR/pyodin/conf/odinsys.conf"
rm -rf "$DEPLOY_DIR/pyodin/conf/odinsyslogger.conf"
rm -rf "$DEPLOY_DIR/pyodin/conf/odinmonitor.conf"
rm -rf "$DEPLOY_DIR/pyodin/test"
rm -rf "$DEPLOY_DIR/client/app/config.json"
rm -rf "$DEPLOY_DIR/server/test"
rm -rf "$DEPLOY_DIR/server/logs/*.log"
rm -rf "$DEPLOY_DIR/server/config/config.json"
rm -rf "$DEPLOY_DIR/server/config.js"
rm -rf "$DEPLOY_DIR/server/.gitignore"
rm -rf "$DEPLOY_DIR/server/.travis.yml"
rm -rf "$DEPLOY_DIR/server/gruntFile.js"
rm -rf "$DEPLOY_DIR/server/generatePackages.js"
rm -rf "$DEPLOY_DIR/server/Makefile"
rm -rf "$DEPLOY_DIR/server/TODO.txt"
mkdir "$DEPLOY_DIR/docs"
cp -aR README.pdf "$DEPLOY_DIR/docs"
find ${DEPLOY_DIR}/* -name CVS -prune -exec rm -rf {} \;
find ${DEPLOY_DIR}/* -name .svn -prune -exec rm -rf {} \;
find ${DEPLOY_DIR}/* -name .pyc -prune -exec rm -rf {} \;
DEPLOY_FILE_NAME="odin_${VER_MAJOR}_${VER_MINOR}_${VER_PATCH}_${VER_FLAG}".tar.gz
tar cvzf "$DEPLOY_FILE_NAME" "$DEPLOY_DIR"
if [ ! -f "$DEPLOY_FILE_NAME" ]; then
echo "Deploy build failed."
rm -rf "$DEPLOY_DIR"
exit 1
fi
rm -rf "$DEPLOY_DIR"
echo "Deploy build complete."