|
1 #!/bin/sh |
|
2 |
|
3 # Script to create a "release" subdirectory. This is a subdirectory |
|
4 # containing a bunch of symlinks, from which the app can be updated. |
|
5 # The main reason for this is to import Django from a zipfile, which |
|
6 # saves dramatically in upload time: statting and computing the SHA1 |
|
7 # for 1000s of files is slow. Even if most of those files don't |
|
8 # actually need to be uploaded, they still add to the work done for |
|
9 # each update. |
|
10 |
|
11 ZIPFILE=django.zip |
|
12 RELEASE=../release |
|
13 APP_FOLDER="../app" |
|
14 APP_FILES="app.yaml index.yaml __init__.py main.py settings.py urls.py" |
|
15 APP_DIRS="soc ghop gsoc" |
|
16 |
|
17 # Remove old $ZIPFILE file. |
|
18 rm -rf $ZIPFILE |
|
19 |
|
20 # Create new $ZIPFILE file. |
|
21 # We prune: |
|
22 # - .svn subdirectories for obvious reasons. |
|
23 # - contrib/gis/ and related files because it's huge and unneeded. |
|
24 # - *.po and *.mo files because they are bulky and unneeded. |
|
25 # - *.pyc and *.pyo because they aren't used by App Engine anyway. |
|
26 DJANGO_DIR=$APP_FOLDER"/django" |
|
27 zip -q $APP_FOLDER/$ZIPFILE `find $DJANGO_DIR \ |
|
28 -name .svn -prune -o \ |
|
29 -name gis -prune -o \ |
|
30 -name admin -prune -o \ |
|
31 -name localflavor -prune -o \ |
|
32 -name mysql -prune -o \ |
|
33 -name mysql_old -prune -o \ |
|
34 -name oracle -prune -o \ |
|
35 -name postgresql-prune -o \ |
|
36 -name postgresql_psycopg2 -prune -o \ |
|
37 -name sqlite3 -prune -o \ |
|
38 -name test -prune -o \ |
|
39 -type f ! -name \*.py[co] ! -name \*.[pm]o -print` |
|
40 |
|
41 # Remove old $RELEASE directory. |
|
42 rm -rf $RELEASE |
|
43 |
|
44 # Create new $RELEASE directory. |
|
45 mkdir $RELEASE |
|
46 |
|
47 # Create symbolic links. |
|
48 for x in $APP_FILES $APP_DIRS $ZIPFILE |
|
49 do |
|
50 ln -s $APP_FOLDER/$x $RELEASE/$x |
|
51 done |