Skip to content

Instantly share code, notes, and snippets.

@alister
Created November 22, 2011 15:00
Show Gist options
  • Save alister/1385857 to your computer and use it in GitHub Desktop.
Save alister/1385857 to your computer and use it in GitHub Desktop.
svnExport.sh
#!/bin/sh
REV=1914
REVDIR=$REV.20080214.1914
REPOSITORY=svn+ssh://username@svn.example.com/var/svn/SITEURL/trunk
IMAGES=$REVDIR/htdocs/i
STATIC1=$REVDIR/example.co.uk
svn export --revision $REV $REPOSITORY $REVDIR
mkdir -p $REVDIR/tmp/templates_c
chown -R www-data: $REVDIR
chmod -R 777 $REVDIR/tmp $REVDIR/htdocs/cache/
chown -R nobody: $REVDIR/tmp $REVDIR/htdocs/cache/ $IMAGES $STATIC1
dos2unix $REVDIR/bin/*sh $REVDIR/bin/*php
chmod 755 $REVDIR/bin/*sh $REVDIR/bin/*php
# chmod -x all the non-directories in images
find $IMAGES -type f -perm -a+x | xargs -r chmod --quiet -x
find $STATIC1 -type f -perm -a+x | xargs -r chmod --quiet -x
ls -l $IMAGES/* | grep -- "-x"
# make the latest version available at http://dev.example.com
rm dev && ln -s $REVDIR dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment