SHINDIG-922 by Nagy Attila - Changes the per-instance connection to a static one...
[shindig.git] / php / make-release.sh
blobfdca46a0b3d32d7ee05ed8d1b8d650727f5a899e
1 #!/bin/bash
3 #### Settings, feel free to adjust these as required ####
5 VERSION=SNAPSHOT
6 NAME="shindig-${VERSION}"
7 OPWD=`pwd`
9 #### Build a clean php-shindig tarball
11 echo "Creating $NAME release files"
13 # remove any old work that may have remained
14 echo " Removing old temp directory and files.."
15 rm -rf /tmp/$NAME
16 rm -rf $NAME.tar.gz $NAME.zip $NAME.tar.bz2
18 # create temp dir and copy files from current path
19 echo " Creating new structure, copying php, features and samples files.."
20 mkdir -p /tmp/$NAME
21 cp -r * /tmp/$NAME
22 cp -r ../features /tmp/$NAME/
23 cp -r ../javascript /tmp/$NAME
24 cp .htaccess /tmp/$NAME
25 cp ../{COMMITTERS,COPYING,DISCLAIMER,LICENSE,NOTICE} /tmp/$NAME
26 cp ../config/{oauth.json,container.js} /tmp/$NAME/config/
27 cd /tmp/$NAME
29 # remove those pesky .svn directories
30 echo " Removing unwanted files"
31 rm -f *.gz *.bz2 *.zip make-release.sh
32 find . -name ".svn" -exec rm -rf {} \; &>/dev/null
33 find . -name "pom.xml" -exec rm -f {} \; &>/dev/null
35 # and rewrite the container.php file to use the different release file paths (features/ instead of ../features, etc)
36 echo " Rewriting default configuration to release structure"
37 cd /tmp/$NAME/config
38 cat container.php | sed "s/\/..\/..\//\/..\//" > container.php.new
39 mv container.php.new container.php
41 # and create the final tar.gz, tar.bz2 and .zip files
42 cd /tmp
43 echo " Creating $OPWD/$NAME.tar.gz"
44 tar c $NAME | gzip > $OPWD/$NAME.tar.gz
45 echo " Creating $OPWD/$NAME.tar.bz2"
46 tar c $NAME | bzip2 > $OPWD/$NAME.tar.bz2
47 echo " Creating $OPWD/$NAME.zip"
48 zip -r $OPWD/$NAME.zip $NAME &>/dev/null
50 echo " Removing temp files"
51 rm -rf /tmp/$NAME