scripts/make_release.sh
changeset 159 451f39c0e1aa
parent 158 2d5a7c18f9ea
child 160 269462f166ef
equal deleted inserted replaced
158:2d5a7c18f9ea 159:451f39c0e1aa
     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 DJANGO_ZIPFILE=django.zip
       
    12 DEFAULT_APP_RELEASE=../release
    11 DEFAULT_APP_RELEASE=../release
    13 DEFAULT_APP_FOLDER="../app"
    12 DEFAULT_APP_FOLDER="../app"
    14 DEFAULT_APP_FILES="app.yaml index.yaml __init__.py main.py settings.py urls.py"
    13 DEFAULT_APP_FILES="app.yaml index.yaml __init__.py main.py settings.py urls.py"
    15 DEFAULT_APP_DIRS="soc ghop gsoc feedparser tiny_mce"
    14 DEFAULT_APP_DIRS="soc ghop gsoc feedparser"
       
    15 DEFAULT_ZIP_FILES="django.zip tiny_mce.zip"
    16 
    16 
    17 APP_RELEASE=${APP_RELEASE:-"${DEFAULT_APP_RELEASE}"}
    17 APP_RELEASE=${APP_RELEASE:-"${DEFAULT_APP_RELEASE}"}
    18 APP_FOLDER=${APP_FOLDER:-"${DEFAULT_APP_FOLDER}"}
    18 APP_FOLDER=${APP_FOLDER:-"${DEFAULT_APP_FOLDER}"}
    19 APP_FILES=${APP_FILES:-"${DEFAULT_APP_FILES}"}
    19 APP_FILES=${APP_FILES:-"${DEFAULT_APP_FILES}"}
    20 APP_DIRS=${APP_DIRS:-"${DEFAULT_APP_DIRS}"}
    20 APP_DIRS=${APP_DIRS:-"${DEFAULT_APP_DIRS}"}
       
    21 ZIP_FILES=${ZIP_FILES:-"${DEFAULT_ZIP_FILES}"}
    21 
    22 
    22 cd $APP_FOLDER
    23 cd $APP_FOLDER
    23 # Remove old $DJANGO_ZIPFILE file.
    24 # Remove old zip files
    24 rm -rf $DJANGO_ZIPFILE
    25 rm -rf $ZIP_FILES
    25 
    26 
    26 # Create new $DJANGO_ZIPFILE file.
    27 # Create new django.zip file.
    27 # We prune:
    28 # We prune:
    28 # - .svn subdirectories for obvious reasons.
    29 # - .svn subdirectories for obvious reasons.
    29 # - contrib/gis/ and related files because it's huge and unneeded.
    30 # - contrib/gis/ and related files because it's huge and unneeded.
    30 # - *.po and *.mo files because they are bulky and unneeded.
    31 # - *.po and *.mo files because they are bulky and unneeded.
    31 # - *.pyc and *.pyo because they aren't used by App Engine anyway.
    32 # - *.pyc and *.pyo because they aren't used by App Engine anyway.
    32 DJANGO_DIR="django"
       
    33 
    33 
    34 zip -q $DJANGO_ZIPFILE `find $DJANGO_DIR \
    34 zip -q django.zip `find django \
    35     -name .svn -prune -o \
    35     -name .svn -prune -o \
    36     -name gis -prune -o \
    36     -name gis -prune -o \
    37     -name admin -prune -o \
    37     -name admin -prune -o \
    38     -name localflavor -prune -o \
    38     -name localflavor -prune -o \
    39     -name mysql -prune -o \
    39     -name mysql -prune -o \
    43     -name postgresql_psycopg2 -prune -o \
    43     -name postgresql_psycopg2 -prune -o \
    44     -name sqlite3 -prune -o \
    44     -name sqlite3 -prune -o \
    45     -name test -prune -o \
    45     -name test -prune -o \
    46     -type f ! -name \*.py[co] ! -name *.[pm]o -print`
    46     -type f ! -name \*.py[co] ! -name *.[pm]o -print`
    47 
    47 
       
    48 # Create new tiny_mce.zip file.
       
    49 # We prune:
       
    50 # - .svn subdirectories for obvious reasons.
       
    51 
       
    52 pushd tiny_mce > /dev/null
       
    53 zip -q ../tiny_mce.zip `find . \
       
    54     -name .svn -prune -o \
       
    55     -type f -print`
       
    56 popd > /dev/null
       
    57 
    48 # Remove old $APP_RELEASE directory.
    58 # Remove old $APP_RELEASE directory.
    49 rm -rf $APP_RELEASE
    59 rm -rf $APP_RELEASE
    50 
    60 
    51 # Create new $APP_RELEASE directory.
    61 # Create new $APP_RELEASE directory.
    52 mkdir $APP_RELEASE
    62 mkdir $APP_RELEASE
    53 
    63 
    54 # Create symbolic links.
    64 # Create symbolic links.
    55 for x in $APP_FILES $APP_DIRS $DJANGO_ZIPFILE
    65 for x in $APP_FILES $APP_DIRS $ZIP_FILES
    56 do
    66 do
    57     #echo $APP_FOLDER/$x $APP_RELEASE/$x
       
    58     ln -s $APP_FOLDER/$x $APP_RELEASE/$x
    67     ln -s $APP_FOLDER/$x $APP_RELEASE/$x
    59 done
    68 done
    60 
    69 
    61 echo "Release created in $APP_RELEASE."
    70 echo "Release created in $APP_RELEASE."
       
    71