forked from metachris/appengine-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload_to_appengine.sh
executable file
·62 lines (50 loc) · 1.09 KB
/
upload_to_appengine.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
# Point CMD_APPCFG to your local appengine-sdk/appcfg.py
CMD_APPCFG=""
# Cache current directory
DIR=$( pwd )
function static_revert {
# Set /static back to dev environment
set -e
echo "Setting /static back to /static_dev"
cd app
rm static
ln -s static_dev static
cd "$DIR"
set +e
}
function static_toprod {
# Set build script results as /static
set -e
echo "Setting /static to /static_dev/publish"
cd app
rm static
ln -s static_dev/publish static
cd "$DIR"
set +e
}
function upload {
# Upload to appengine
if [ $CMD_APPCFG ]; then
$CMD_APPCFG update app
else
echo "Error: You need to edit upload_to_appengine.sh: point CMD_APPCFG to your local appengine's appcfg.py"
fi
}
function build {
cd app/static_dev/build
ant minify
cd "$DIR"
}
read -p "Build the project with 'ant minify' now? [yN]" yn
case $yn in
[Yy]* ) build;;
[Nn]* ) ;;
esac
static_toprod
read -p "You can now test the latest build. Do you wish to upload this version? [yN]" yn
case $yn in
[Yy]* ) upload;;
[Nn]* ) ;;
esac
static_revert