-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy.sh
executable file
·59 lines (51 loc) · 1.55 KB
/
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
#!/bin/bash
echo "Please type the new version number."
echo "Check latest version here: https://github.com/eBioKit/ebiokit-site/releases"
version=$(date +"%y.%m")
read -p "New version (e.g. ${version}):" VERSION
if [[ "$VERSION" == "" ]]; then
echo "Version number not specified. Using ${version}"
VERSION=${version}
fi
OLD_PWD=$(pwd)
# Copy the app code to a temporal location
rm -rf /tmp/ebiokit-site
echo "Copying the app code..."
rsync -ar ../ebiokit-site/ /tmp/ebiokit-site
cd /tmp/ebiokit-site
echo "Copying the app code... DONE"
# Build client
cd client/
mkdir dist
echo "Compiling client application..."
~/Desktop/workspace/app_minifier/minify /tmp/ebiokit-site/client
mv /tmp/minified/client/* dist
echo "Compiling client application... DONE"
cd ../server/
echo "Updating version number"
sed -i 's/APP_VERSION = [0-9\.]*/APP_VERSION = '$VERSION'/' config/settings.py
echo "eBioKit $VERSION" > ../VERSION
echo "Compiling server application... "
# Disable the DEBUG mode
sed -i 's/DEBUG = True/DEBUG = False/' config/settings.py
# Collect the static files
python manage.py collectstatic
# Remove unused files
rm -r .idea
cd ..
rm -r client/
rm -r docs/
rm -r .env/
echo "Compiling server application... DONE"
echo ""
echo ""
echo "DONE! Now you could send the changes as a new release. "
echo "For example:"
echo "git push origin :minified"
echo "git branch -d minified"
echo "git checkout -b minified"
echo "git add -A"
echo "git commit -m \"Minified (v`cat VERSION | cut -d' ' -f2`)\""
echo "git push origin minified"
echo ""
echo "Run server with uwsgi --ini uwsgi.ini"