SF.net SVN: geany-plugins:[1496] www/staging
dmaphy at users.sourceforge.net
dmaphy at xxxxx
Sat Jul 31 21:26:35 UTC 2010
Revision: 1496
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1496&view=rev
Author: dmaphy
Date: 2010-07-31 21:26:35 +0000 (Sat, 31 Jul 2010)
Log Message:
-----------
move push2stable.sh to push.sh and write it a bit more generic to also handle a push2preview
Added Paths:
-----------
www/staging/push.sh
Removed Paths:
-------------
www/staging/push2stable.sh
Copied: www/staging/push.sh (from rev 1492, www/staging/push2stable.sh)
===================================================================
--- www/staging/push.sh (rev 0)
+++ www/staging/push.sh 2010-07-31 21:26:35 UTC (rev 1496)
@@ -0,0 +1,80 @@
+#!/bin/bash
+
+#~ set -x
+
+SOURCEDIR="/home/dmaphy/webroot/websites/plugins.geany.org/"
+PREVIEWDIR="/home/dmaphy/plugins.geany.org_preview/"
+STABLEDIR="/home/dmaphy/plugins.geany.org_stable/"
+BACKUPDIR="/home/dmaphy/plugins.geany.org.backup/"
+EXCLUDE=".svn gencontent.sh push2stable.sh rst2html_template.txt templates tidy.conf rst2html_config.conf"
+
+
+if [ ! -d $SOURCEDIR ]; then
+ echo "Could not find $SOURCEDIR. Exiting..";
+ exit 127;
+fi
+
+
+catch_error()
+{
+ RC=$1;
+ if [ $RC -eq 0 ]; then
+ echo "done."
+ else
+ echo "failed. Exiting...";
+ exit 127;
+ fi
+}
+
+
+if [ ! -d $PREVIEWDIR ]; then
+ echo "Could not find $PREVIEWDIR. Trying to create...";
+ mkdir -p $PREVIEWDIR;
+ catch_error $?;
+fi
+
+
+if [ ! -d $STABLEDIR ]; then
+ echo "Could not find $STABLEDIR. Trying to create...";
+ mkdir -p $STABLEDIR;
+ catch_error $?;
+fi
+
+
+if [ ! -d $BACKUPDIR ]; then
+ echo "Could not find $BACKUPDIR. Trying to create...";
+ mkdir -p $BACKUPDIR;
+ catch_error $?;
+fi
+
+
+EXARG=""
+for i in $EXCLUDE;
+do
+ EXARG="$EXARG --exclude $i";
+done
+
+
+if [ -z $1 ]; then
+ echo "Usage: $0 [preview|stable]";
+else
+ case $1 in
+ "preview")
+ # backup is not necessary, when pushing to preview..
+ rsync -avC $EXARG --delete $PREVIEWDIR $STABLEDIR
+ ;;
+ "stable")
+ # check if $STABLEDIR is empty and backup if it is not
+ ls $STABLEDIR/* > /dev/null 2>&1;
+ if [ $? -eq 0 ]; then
+ rsync -avC $EXARG --delete $STABLEDIR $BACKUPDIR
+ fi
+
+ rsync -avC $EXARG --delete $PREVIEWDIR $STABLEDIR
+ ;;
+ *)
+ echo "Usage: $0 [preview|stable]";
+ ;;
+ esac
+
+fi
Deleted: www/staging/push2stable.sh
===================================================================
--- www/staging/push2stable.sh 2010-07-31 19:56:33 UTC (rev 1495)
+++ www/staging/push2stable.sh 2010-07-31 21:26:35 UTC (rev 1496)
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-#~ set -x
-
-PREVIEWDIR="/home/dmaphy/webroot/websites/plugins.geany.org/"
-STABLEDIR="/home/dmaphy/plugins.geany.org/"
-BACKUPDIR="/home/dmaphy/plugins.geany.org.backup/"
-EXCLUDE=".svn gencontent.sh push2stable.sh rst2html_template.txt templates tidy.conf rst2html_config.conf"
-
-if [ ! -d $PREVIEWDIR ]; then
- echo "Could not find $PREVIEWDIR. Exiting..";
- exit 127;
-fi
-
-if [ ! -d $STABLEDIR ]; then
- echo "Could not find $STABLEDIR. Trying to create...";
- mkdir -p $STABLEDIR;
-fi
-
-if [ ! -d $BACKUPDIR ]; then
- echo "Could not find $BACKUPDIR. Trying to create...";
- mkdir -p $BACKUPDIR;
-fi
-
-EXARG=""
-for i in $EXCLUDE;
-do
- EXARG="$EXARG --exclude $i"
-done
-
-
-# check if $STABLEDIR is empty and backup if it is not
-ls $STABLEDIR/* > /dev/null 2>&1;
-if [ $? -eq 0 ]; then
- rsync -avC $EXARG --delete $STABLEDIR $BACKUPDIR
-fi
-
-rsync -avC $EXARG --delete $PREVIEWDIR $STABLEDIR
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Plugins-Commits
mailing list