scripts/make_release.sh
changeset 150 715b07485c48
parent 144 53d8b8064019
child 157 8a64fc6b9d0e
equal deleted inserted replaced
149:f2e327a7c5de 150:715b07485c48
     6 # saves dramatically in upload time: statting and computing the SHA1
     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
     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
     8 # actually need to be uploaded, they still add to the work done for
     9 # each update.
     9 # each update.
    10 
    10 
    11 ZIPFILE=django.zip
    11 DJANGO_ZIPFILE=django.zip
    12 RELEASE=../release
    12 RELEASE=../release
    13 APP_FOLDER="../app"
    13 APP_FOLDER="../app"
    14 APP_FILES="app.yaml index.yaml __init__.py main.py settings.py urls.py"
    14 APP_FILES="app.yaml index.yaml __init__.py main.py settings.py urls.py"
    15 APP_DIRS="soc ghop gsoc"
    15 APP_DIRS="soc ghop gsoc"
    16 
    16 
       
    17 cd $APP_FOLDER
    17 # Remove old $ZIPFILE file.
    18 # Remove old $ZIPFILE file.
    18 rm -rf $ZIPFILE
    19 rm -rf $DJANGO_ZIPFILE
    19 
    20 
    20 # Create new $ZIPFILE file.
    21 # Create new $ZIPFILE file.
    21 # We prune:
    22 # We prune:
    22 # - .svn subdirectories for obvious reasons.
    23 # - .svn subdirectories for obvious reasons.
    23 # - contrib/gis/ and related files because it's huge and unneeded.
    24 # - contrib/gis/ and related files because it's huge and unneeded.
    24 # - *.po and *.mo files because they are bulky and unneeded.
    25 # - *.po and *.mo files because they are bulky and unneeded.
    25 # - *.pyc and *.pyo because they aren't used by App Engine anyway.
    26 # - *.pyc and *.pyo because they aren't used by App Engine anyway.
    26 DJANGO_DIR=$APP_FOLDER"/django"
    27 DJANGO_DIR="django"
    27 zip -q $APP_FOLDER/$ZIPFILE `find $DJANGO_DIR \
    28 
       
    29 zip -q $DJANGO_ZIPFILE `find $DJANGO_DIR \
    28     -name .svn -prune -o \
    30     -name .svn -prune -o \
    29     -name gis -prune -o \
    31     -name gis -prune -o \
    30     -name admin -prune -o \
    32     -name admin -prune -o \
    31     -name localflavor -prune -o \
    33     -name localflavor -prune -o \
    32     -name mysql -prune -o \
    34     -name mysql -prune -o \
    34     -name oracle -prune -o \
    36     -name oracle -prune -o \
    35     -name postgresql-prune -o \
    37     -name postgresql-prune -o \
    36     -name postgresql_psycopg2 -prune -o \
    38     -name postgresql_psycopg2 -prune -o \
    37     -name sqlite3 -prune -o \
    39     -name sqlite3 -prune -o \
    38     -name test -prune -o \
    40     -name test -prune -o \
    39     -type f ! -name \*.py[co] ! -name \*.[pm]o -print`
    41     -type f ! -name \*.py[co] ! -name *.[pm]o -print`
    40 
    42 
    41 # Remove old $RELEASE directory.
    43 # Remove old $RELEASE directory.
    42 rm -rf $RELEASE
    44 rm -rf $RELEASE
    43 
    45 
    44 # Create new $RELEASE directory.
    46 # Create new $RELEASE directory.
    45 mkdir $RELEASE
    47 mkdir $RELEASE
    46 
    48 
    47 # Create symbolic links.
    49 # Create symbolic links.
    48 for x in $APP_FILES $APP_DIRS $ZIPFILE
    50 for x in $APP_FILES $APP_DIRS $DJANGO_ZIPFILE
    49 do
    51 do
       
    52     echo $APP_FOLDER/$x $RELEASE/$x
    50     ln -s $APP_FOLDER/$x $RELEASE/$x
    53     ln -s $APP_FOLDER/$x $RELEASE/$x
    51 done
    54 done