-
Notifications
You must be signed in to change notification settings - Fork 7
/
deploy.sh
executable file
·40 lines (31 loc) · 938 Bytes
/
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
#!/bin/sh
# Exit on error
set -e
# Dump wq configuration object to file
db/manage.py dump_config --format amd > app/js/data/config.js
# (Re-)generate templates for all registered models
wq maketemplates \
--django-dir db \
--input-dir master_templates \
--template-dir templates
# Build javascript with wq.app
cd app;
wq icons;
wq build $1;
# Force important files through any unwanted server caching
cd ../;
sed -i "s/speciestracker.js/speciestracker.js?v="$1"/" htdocs-build/speciestracker.appcache
sed -i "s/speciestracker.css/speciestracker.css?v="$1"/" htdocs-build/speciestracker.appcache
# Preserve Django's static files (e.g. admin)
if [ -d htdocs/static ]; then
cp -a htdocs/static htdocs-build/static
fi;
# Replace existing htdocs with new version
rm -rf htdocs;
mv -i htdocs-build/ htdocs;
# Restart Django
touch db/speciestracker/wsgi.py
# Build PhoneGap application
cd app;
wq phonegap $1
cd ../;