author | Pawel Solyga <Pawel.Solyga@gmail.com> |
Tue, 16 Sep 2008 15:56:15 +0000 | |
changeset 150 | 715b07485c48 |
parent 144 | 53d8b8064019 |
child 157 | 8a64fc6b9d0e |
permissions | -rwxr-xr-x |
144
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
1 |
#!/bin/sh |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
2 |
|
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
3 |
# Script to create a "release" subdirectory. This is a subdirectory |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
4 |
# containing a bunch of symlinks, from which the app can be updated. |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
5 |
# The main reason for this is to import Django from a zipfile, which |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
6 |
# saves dramatically in upload time: statting and computing the SHA1 |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
7 |
# for 1000s of files is slow. Even if most of those files don't |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
8 |
# actually need to be uploaded, they still add to the work done for |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
9 |
# each update. |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
10 |
|
150
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
11 |
DJANGO_ZIPFILE=django.zip |
144
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
12 |
RELEASE=../release |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
13 |
APP_FOLDER="../app" |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
14 |
APP_FILES="app.yaml index.yaml __init__.py main.py settings.py urls.py" |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
15 |
APP_DIRS="soc ghop gsoc" |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
16 |
|
150
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
17 |
cd $APP_FOLDER |
144
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
18 |
# Remove old $ZIPFILE file. |
150
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
19 |
rm -rf $DJANGO_ZIPFILE |
144
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
20 |
|
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
21 |
# Create new $ZIPFILE file. |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
22 |
# We prune: |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
23 |
# - .svn subdirectories for obvious reasons. |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
24 |
# - contrib/gis/ and related files because it's huge and unneeded. |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
25 |
# - *.po and *.mo files because they are bulky and unneeded. |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
26 |
# - *.pyc and *.pyo because they aren't used by App Engine anyway. |
150
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
27 |
DJANGO_DIR="django" |
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
28 |
|
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
29 |
zip -q $DJANGO_ZIPFILE `find $DJANGO_DIR \ |
144
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
30 |
-name .svn -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
31 |
-name gis -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
32 |
-name admin -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
33 |
-name localflavor -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
34 |
-name mysql -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
35 |
-name mysql_old -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
36 |
-name oracle -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
37 |
-name postgresql-prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
38 |
-name postgresql_psycopg2 -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
39 |
-name sqlite3 -prune -o \ |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
40 |
-name test -prune -o \ |
150
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
41 |
-type f ! -name \*.py[co] ! -name *.[pm]o -print` |
144
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
42 |
|
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
43 |
# Remove old $RELEASE directory. |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
44 |
rm -rf $RELEASE |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
45 |
|
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
46 |
# Create new $RELEASE directory. |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
47 |
mkdir $RELEASE |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
48 |
|
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
49 |
# Create symbolic links. |
150
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
50 |
for x in $APP_FILES $APP_DIRS $DJANGO_ZIPFILE |
144
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
51 |
do |
150
715b07485c48
Changed ZIPFILE variable to DJANGO_ZIPFILE in make_release.sh script and added 'cd $APP_FOLDER' before we zip django.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
144
diff
changeset
|
52 |
echo $APP_FOLDER/$x $RELEASE/$x |
144
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
53 |
ln -s $APP_FOLDER/$x $RELEASE/$x |
53d8b8064019
Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
54 |
done |