Updated make_release.sh docs and added way for person invoking the script to override script variables such as RELEASE using something like "RELEASE=../testing_release ./make_release.sh".
authorPawel Solyga <Pawel.Solyga@gmail.com>
Tue, 16 Sep 2008 17:38:09 +0000
changeset 158 2d5a7c18f9ea
parent 157 8a64fc6b9d0e
child 159 451f39c0e1aa
Updated make_release.sh docs and added way for person invoking the script to override script variables such as RELEASE using something like "RELEASE=../testing_release ./make_release.sh".
scripts/make_release.sh
--- a/scripts/make_release.sh	Tue Sep 16 17:07:58 2008 +0000
+++ b/scripts/make_release.sh	Tue Sep 16 17:38:09 2008 +0000
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Script to create a "release" subdirectory.  This is a subdirectory
 # containing a bunch of symlinks, from which the app can be updated.
@@ -9,16 +9,21 @@
 # each update.
 
 DJANGO_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 feedparser tiny_mce"
+DEFAULT_APP_RELEASE=../release
+DEFAULT_APP_FOLDER="../app"
+DEFAULT_APP_FILES="app.yaml index.yaml __init__.py main.py settings.py urls.py"
+DEFAULT_APP_DIRS="soc ghop gsoc feedparser tiny_mce"
+
+APP_RELEASE=${APP_RELEASE:-"${DEFAULT_APP_RELEASE}"}
+APP_FOLDER=${APP_FOLDER:-"${DEFAULT_APP_FOLDER}"}
+APP_FILES=${APP_FILES:-"${DEFAULT_APP_FILES}"}
+APP_DIRS=${APP_DIRS:-"${DEFAULT_APP_DIRS}"}
 
 cd $APP_FOLDER
-# Remove old $ZIPFILE file.
+# Remove old $DJANGO_ZIPFILE file.
 rm -rf $DJANGO_ZIPFILE
 
-# Create new $ZIPFILE file.
+# Create new $DJANGO_ZIPFILE file.
 # We prune:
 # - .svn subdirectories for obvious reasons.
 # - contrib/gis/ and related files because it's huge and unneeded.
@@ -40,15 +45,17 @@
     -name test -prune -o \
     -type f ! -name \*.py[co] ! -name *.[pm]o -print`
 
-# Remove old $RELEASE directory.
-rm -rf $RELEASE
+# Remove old $APP_RELEASE directory.
+rm -rf $APP_RELEASE
 
-# Create new $RELEASE directory.
-mkdir $RELEASE
+# Create new $APP_RELEASE directory.
+mkdir $APP_RELEASE
 
 # Create symbolic links.
 for x in $APP_FILES $APP_DIRS $DJANGO_ZIPFILE
 do
-    echo $APP_FOLDER/$x $RELEASE/$x
-    ln -s $APP_FOLDER/$x $RELEASE/$x
+    #echo $APP_FOLDER/$x $APP_RELEASE/$x
+    ln -s $APP_FOLDER/$x $APP_RELEASE/$x
 done
+
+echo "Release created in $APP_RELEASE."