-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_deploy.sh
executable file
·60 lines (44 loc) · 1.12 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
#!/bin/bash
#
#
# Description : Prepare deploy packages for odin application.
# Author : vassilux
# Last modified : 2014-05-30 14:37:47
#
set -e
VERSION=$(cat VERSION)
DEPLOY_DIR="avor_${VERSION}"
DEPLOY_FILE_NAME="avor_${VERSION}.tar.gz"
if [ -d "$DEPLOY_DIR" ]; then
rm -rf "$DEPLOY_DIR"
fi
#
if [ -f "$DEPLOY_FILE_NAME" ]; then
rm -rf "$DEPLOY_FILE_NAME"
fi
#
#
mkdir "$DEPLOY_DIR"
cp -aR app/* "$DEPLOY_DIR"
mkdir "$DEPLOY_DIR/docs"
sleep 1
pandoc -o "$DEPLOY_DIR/docs/INSTALL.html" ./docs/INSTALL.md
pandoc -o "$DEPLOY_DIR/docs/ReleaseNotes.html" ./docs/ReleaseNotes.md
cp "$DEPLOY_DIR/docs/INSTALL.html" .
cp "$DEPLOY_DIR/docs/ReleaseNotes.html" .
rm -rf "$DEPLOY_DIR/bower_components.tar.gz"
rm -rf "$DEPLOY_DIR/bower_components"
#find ${DEPLOY_DIR} -name CVS -prune -exec rm -rf {} \;
tar cvzf "${DEPLOY_FILE_NAME}" "${DEPLOY_DIR}"
if [ ! -f "$DEPLOY_FILE_NAME" ]; then
echo "Deploy build failed."
exit 1
fi
if [ ! -d releases ]; then
mkdir releases
fi
mv ${DEPLOY_FILE_NAME} ./releases
mv INSTALL.* ./releases
mv ReleaseNotes.* ./releases
rm -rf "$DEPLOY_DIR"
echo "Deploy build complete."