# HG changeset patch # User Pawel Solyga # Date 1221424352 0 # Node ID 53d8b8064019b1d57f63e390f38d6e0b21027dc9 # Parent b419121f7b3e3a9214bed7cd1f451d27fecc03d4 Release shell script and associated changes. Set svn:ignore property on /app/django.zip file and /release folder. Patch by: Pawel Solyga, Augie Fackler Review by: Todd Larsen, review-after-commit Review issue: 363 Review URL: http://codereviews.googleopensourceprograms.com/363 diff -r b419121f7b3e -r 53d8b8064019 app/main.py --- a/app/main.py Sun Sep 14 00:23:49 2008 +0000 +++ b/app/main.py Sun Sep 14 20:32:32 2008 +0000 @@ -35,6 +35,8 @@ # from it. This lets us replace the built-in Django sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) +sys.path.insert(0, os.path.abspath('django.zip')) + # Force Django to reload its settings. from django.conf import settings settings._target = None diff -r b419121f7b3e -r 53d8b8064019 scripts/make_release.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/make_release.sh Sun Sep 14 20:32:32 2008 +0000 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Script to create a "release" subdirectory. This is a subdirectory +# containing a bunch of symlinks, from which the app can be updated. +# The main reason for this is to import Django from a zipfile, which +# saves dramatically in upload time: statting and computing the SHA1 +# for 1000s of files is slow. Even if most of those files don't +# actually need to be uploaded, they still add to the work done for +# each update. + +ZIPFILE=django.zip +RELEASE=../release +APP_FOLDER="../app" +APP_FILES="app.yaml index.yaml __init__.py main.py settings.py urls.py" +APP_DIRS="soc ghop gsoc" + +# Remove old $ZIPFILE file. +rm -rf $ZIPFILE + +# Create new $ZIPFILE file. +# We prune: +# - .svn subdirectories for obvious reasons. +# - contrib/gis/ and related files because it's huge and unneeded. +# - *.po and *.mo files because they are bulky and unneeded. +# - *.pyc and *.pyo because they aren't used by App Engine anyway. +DJANGO_DIR=$APP_FOLDER"/django" +zip -q $APP_FOLDER/$ZIPFILE `find $DJANGO_DIR \ + -name .svn -prune -o \ + -name gis -prune -o \ + -name admin -prune -o \ + -name localflavor -prune -o \ + -name mysql -prune -o \ + -name mysql_old -prune -o \ + -name oracle -prune -o \ + -name postgresql-prune -o \ + -name postgresql_psycopg2 -prune -o \ + -name sqlite3 -prune -o \ + -name test -prune -o \ + -type f ! -name \*.py[co] ! -name \*.[pm]o -print` + +# Remove old $RELEASE directory. +rm -rf $RELEASE + +# Create new $RELEASE directory. +mkdir $RELEASE + +# Create symbolic links. +for x in $APP_FILES $APP_DIRS $ZIPFILE +do + ln -s $APP_FOLDER/$x $RELEASE/$x +done