[pLog-svn] r6766 - plugins/branches/lifetype-1.2/bin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Mon Dec 22 13:07:05 EST 2008


Author: oscar
Date: 2008-12-22 13:07:05 -0500 (Mon, 22 Dec 2008)
New Revision: 6766

Added:
   plugins/branches/lifetype-1.2/bin/build-all-svn.sh
Modified:
   plugins/branches/lifetype-1.2/bin/build-plugins-nightly.sh
Log:
plugin nightly builds now working

Copied: plugins/branches/lifetype-1.2/bin/build-all-svn.sh (from rev 6764, plog/branches/lifetype-1.2/bin-devel/build-svn.sh)
===================================================================
--- plugins/branches/lifetype-1.2/bin/build-all-svn.sh	                        (rev 0)
+++ plugins/branches/lifetype-1.2/bin/build-all-svn.sh	2008-12-22 18:07:05 UTC (rev 6766)
@@ -0,0 +1,110 @@
+
+#!/bin/bash
+
+# Script to generate distribution builds of LifeType
+#
+# (c) 27-08-2004, the LifeType Team
+#
+#
+# Requires two parameters: the name of the output package and the
+# CVS tag label that will be used to fetch the contents of the build. Therefore,
+# contents must be tagged _before_ running this script. 
+# The same CVS label must be used for both the plog_devel and plog_docs module.
+#
+
+#
+# server and repository path
+#
+SVNSERVER=http://devel.lifetype.net
+SVNREPO=/svn/plog/plugins
+
+#
+# array with the files that we are going to remove before
+# making the package... Wildcards, complete paths, whatever
+# can be used here
+# NOTE: When changing this list, update the list in build-diff.sh as well
+
+TOREMOVE="unported/ bin/"
+
+#
+# helper functions to print things in different colors
+#
+NOCOLOR='\e[0m'
+message()
+{
+ echo -e "\033[01;32m$*$NOCOLOR"
+}
+
+warning()
+{
+ echo -e "\033[01;33m$*$NOCOLOR"
+}
+
+error()
+{
+ echo -e "\033[01;31m$*$NOCOLOR"
+}
+
+# check parameters
+if [ $# -lt 1 ]; then
+    echo "Makes a build off the latest SVN source code and packages it"
+    echo ""
+	echo "Usage: build-svn.sh label package-name"
+	echo ""
+	echo "If package-name is omitted, the name will be lifetype-plugins-<current_date>"
+	echo ""
+	echo "Use HEAD or TRUNK to indicate the main development branch"
+    echo ""
+    echo "Example:"
+    echo ""
+    echo "    $0 branches/lifetype-1.2 lifetype-1.2"
+	exit -1
+fi
+
+SVNTAG=$1
+
+# if there was no package name parameter, then build one using the current date
+if [ $# -eq 1 ]; then
+    PACKAGENAME=lifetype-plugins-`date +%Y%m%d`
+else
+    PACKAGENAME=$2
+fi
+
+message "Using $PACKAGENAME as the package name"
+WORKDIR=`basename $PACKAGENAME`
+BUILDLABEL=`basename $PACKAGENAME`
+
+# determine whether code should be fetched from 
+# plog/trunk or plog/tags/xxxx
+if [ $SVNTAG == "HEAD" -o $SVNTAG == "TRUNK" -o $SVNTAG == "head" -o $SVNTAG == "trunk" ]; then
+   SVNREPO=${SVNREPO}/trunk
+else
+   SVNREPO=${SVNREPO}/${SVNTAG}
+fi
+
+# call the svn command with the correct parameters
+message "Fetching the source code using $SVNTAG label..."
+REV=`svn export $SVNSERVER$SVNREPO $WORKDIR | tail -n 1 | awk '{print $NF}' | tr -d . `
+if [ $? -eq 1 ]; then
+    echo "There was an error fetching the source code. Please try again."
+    exit 1
+fi
+
+# and remove all unnecessary files
+message "Removing unnecessary files...";
+for i in $TOREMOVE
+do
+  echo "  -- removing $i"
+  rm -rf $WORKDIR/$i
+done
+
+# and create the .zip, tar.gz and .tar.bz2 packages
+message "Creating .zip package..."
+zip $BUILDLABEL.zip -r $WORKDIR  > /dev/null
+
+# clean up the temporary folders
+message "Cleaning up..."
+rm -rf $WORKDIR
+
+# done!
+message "Done!"


Property changes on: plugins/branches/lifetype-1.2/bin/build-all-svn.sh
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mergeinfo
   + 

Modified: plugins/branches/lifetype-1.2/bin/build-plugins-nightly.sh
===================================================================
--- plugins/branches/lifetype-1.2/bin/build-plugins-nightly.sh	2008-12-22 18:00:25 UTC (rev 6765)
+++ plugins/branches/lifetype-1.2/bin/build-plugins-nightly.sh	2008-12-22 18:07:05 UTC (rev 6766)
@@ -1,42 +1,44 @@
 #!/bin/sh 
 
+set -e
+set -u
+
 # check parameters
 if [ $# -lt 2 ]; then
     echo "Generates a build of all plugins and moves it to the specified folder"
     echo ""
     echo "Usage: build-plugins-nightly.sh label destination-folder"
     echo ""
+	echo "Use HEAD or TRUNK to indicate the main development branch"
+    echo ""
+    echo "Example:"
+    echo ""
+    echo "    $0 branches/lifetype-1.2 lifetype-1.2"
+    echo "    $0 TRUNK lifetype-trunk"
     exit -1
 fi
 
-echo "*** Build plugins: starting process ***"
-date
-echo "***"
-
 SVNTAG=$1
 DESTFOLDER=$2
-BINPATH=/home/lifetype/bin
+BINPATH=`dirname $0`
+if [ ${BINPATH:0:1} != "/" ]; then
+  BINPATH=`pwd`/$BINPATH
+fi
+PACKAGENAME=lifetype-plugins-`date +%Y%m%d`
 
-pwd
-echo $DESTFOLDER
-echo $SVNTAG
+echo "*** Build: starting process for $SVNTAG ***"
+echo "Destination: $DESTFOLDER"
+date
+echo "***"
 
-# make the package
-cd $BINPATH
-$BINPATH/build-plugins.sh $SVNTAG
+mkdir -p $DESTFOLDER
+pushd $DESTFOLDER > /dev/null
+$BINPATH/build-all-svn.sh $SVNTAG $PACKAGENAME
 
-# move the file to the destination folder
-PACKAGENAME=lifetype-plugins-`date +%Y%m%d`
-mv -f $BINPATH/$PACKAGENAME.zip $DESTFOLDER
-
-# remove everything else
-rm -f $BINPATH/$PACKAGENAME.zip
-rm -f $BINPATH/$PACKAGENAME.tar.gz
-rm -f $BINPATH/$PACKAGENAME.tar.bz2
-
 # make the softlink
-rm $DESTFOLDER/lifetype-plugins-latest.zip
-ln -s $DESTFOLDER/$PACKAGENAME.zip $DESTFOLDER/lifetype-plugins-latest.zip 
+rm -f lifetype-plugins-latest.zip
+ln -s $PACKAGENAME.zip lifetype-plugins-latest.zip 
+popd > /dev/null
 
 echo "*** Build: Nightly build complete!"
 echo "*** Build: build result available in $DESTFOLDER/$PACKAGENAME.zip"



More information about the pLog-svn mailing list