SF.net SVN: morphix: [2570] trunk/morphixlivekiosk
[email protected] Thu, 18 Oct 2007 14:42:37 -0700
| Newsgroups | gmane.linux.morphix.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2570
http://morphix.svn.sourceforge.net/morphix/?rev=2570&view=rev
Author: bmsleight
Date: 2007-10-18 14:42:36 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
KABT Kiosk Automatic Build Test
Modified Paths:
--------------
trunk/morphixlivekiosk/templates/kiosk-builder-settings.xml
Added Paths:
-----------
trunk/morphixlivekiosk/scripts/
trunk/morphixlivekiosk/scripts/kabt.sh
Added: trunk/morphixlivekiosk/scripts/kabt.sh
===================================================================
--- trunk/morphixlivekiosk/scripts/kabt.sh (rev 0)
+++ trunk/morphixlivekiosk/scripts/kabt.sh 2007-10-18 21:42:36 UTC (rev 2570)
@@ -0,0 +1,135 @@
+#!/bin/bash
+#
+# KABT Kiosk Automatic Build Test
+#
+#
+# Copyleft (c) 2007 Brendan M. Sleight #
+# <bmsleight@barwap._REMOVE_SPAM_TRAP.com> #
+# #
+# This script is licensed under the GNU GPL v2 or later. #
+# #
+# On Debian systems, this license can be obtained via #
+# /usr/share/common-licenses/GPL #
+# #
+# Expect this script o be run as a cron job #
+# #
+
+
+am_i_root_exit_if_not ()
+{
+if [ `id -u` -ne 0 ]; then
+ echo "Need to have be able to run the mount command, i.e. must be root"
+ exit
+fi
+}
+
+get_global_variables ()
+{
+TMP_DIR=/tmp/kabt.$$
+TMP_FILE=/tmp/kabt.$$.tmp
+TMP_FILE_2=/tmp/kabt.$$.2.tmp
+mkdir $TMP_DIR
+CACHED=~/.kabt/
+SETUPXMLURL="http://morphix.svn.sourceforge.net/viewvc/*checkout*/morphix/trunk/morphixlivekiosk/templates/kiosk-builder-settings.xml"
+SETUPXML="kiosk-builder-settings.xml"
+}
+
+clean_tmp ()
+{
+rm $TMP_DIR -r 2>/dev/null
+rm $TMP_FILE 2>/dev/null
+rm $TMP_FILE_2 2>/dev/null
+}
+
+xml_get ()
+{
+ RETURN_VALUE=$(xmlstarlet sel -t -m "$1" -v "$2" -v "@$3" -n $4 | sed 's/^[ \t]*//' | sed /^$/d)
+}
+
+xml_get_tmp ()
+{
+ xmlstarlet sel -t -m "$1" -v "$2" -v "@$3" -n $4 | sed 's/^[ \t]*//' | sed /^$/d >$TMP_FILE
+}
+
+
+set_up ()
+{
+if [ -d "$CACHED" ]; then
+ echo "$CACHED exists. Need to remove files"
+ rm $CACHED -R
+fi
+mkdir -p $CACHED/minimodules/
+wget --tries=3 --timeout=60 -nv --directory-prefix=$CACHED $SETUPXMLURL
+xml_get "//kioskbuilder/morphix" "base" "base" $CACHED/$SETUPXML
+wget --tries=3 --timeout=60 -nv --output-document=$CACHED/base $RETURN_VALUE
+xml_get "//kioskbuilder/morphix" "mainmodule" "mainmodule" $CACHED/$SETUPXML
+wget --tries=3 --timeout=60 -nv --output-document=$CACHED/mainmodule.mod $RETURN_VALUE
+xml_get "//kioskbuilder/morphix" "kioskminipre" "kioskminipre" $CACHED/$SETUPXML
+wget --tries=3 --timeout=60 -nv --output-document=$CACHED/mainmodule.mod $RETURN_VALUE
+xml_get_tmp "//kioskbuilder/morphix" "minilist" "MiniModule" $CACHED/$SETUPXML
+RETURN_VALUE=$(cat $TMP_FILE)
+for MINIS in $RETURN_VALUE
+do
+ wget --tries=3 --timeout=60 -nv --directory-prefix=$CACHED/minimodules/ $MINIS
+done
+for MINIS in $CACHED/minimodules/*.xml
+do
+ morphmini $MINIS $MINIS.mod
+done
+}
+
+
+while getopts Snt:l:q:e: opt
+do
+ case "$opt" in
+ S) SETUP="true";;
+ n) NOTESTING="true";;
+ t) TEMPLATE="$OPTARG";;
+ q) QUEUEURL="$OPTARG";;
+ l) LOCALDIR="$OPTARG";;
+ e) EXTERNALURL="$OPTARG";;
+
+ \?) # unknown flag
+ echo >&2 " kabt -S /output/directory/"
+ echo >&2 " kabt [-n] -t template.xml -l /var/www/upload/"
+ echo >&2 " kabt [-n] -q http://example.com/queue/ -l /var/www/upload/ -e www.foobar.com%2Fupload%2F"
+ exit 1;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+#Confirm parameters
+if [ -z "$SETUP$TEMPLATE$QUEUEURL" ]; then
+ echo " kabt -S"
+ echo " kabt [-n] -t template.xml -l /var/www/upload/"
+ echo " kabt [-n] -q http://example.com/queue/ -l /var/www/upload/ -e www.foobar.com%2Fupload%2F"
+ echo
+ echo " -S download all the parts and set-up kabt. "
+ echo " -n Do not test the built kiosk LiveCD"
+ echo " -t using the template build and test a Kiosk LiveCD"
+ echo " -l The local location of the built videos and iso"
+ echo " -q queue.txt Build the first template in the queue.txt"
+ echo " The http://example.com/queue/ contains a plain txt of urls pointing a list of templates.xml "
+ echo " -l The local location of the built videos and iso"
+ echo " -e The external url of the local location"
+ echo " Once build kabt will call "
+ echo " http://example.com/queue/?built=www.foobar.com%2Fupload%2F&v=b123-testing.ogg&i=b123-testing.iso"
+ echo " This should remove the top line of the queue from http://example.com/queue/"
+ echo
+fi
+if [ -n "$TEMPLATE" -a -z "$LOCALDIR" ]; then
+ echo " kabt [-n] -t template.xml -l /var/www/upload/"
+fi
+
+if [ -n "$QUEUEURL" ]; then
+ if [ -z "$LOCALDIR" -o -z "$EXTERNALURL" ]; then
+ echo " kabt [-n] -q http://example.com/queue/ -l /var/www/upload/ -e www.foobar.com%2Fupload%2F"
+ fi
+fi
+
+am_i_root_exit_if_not
+get_global_variables
+clean_tmp
+if [ -n "$SETUP" ]; then
+ set_up
+fi
Property changes on: trunk/morphixlivekiosk/scripts/kabt.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/morphixlivekiosk/templates/kiosk-builder-settings.xml
===================================================================
--- trunk/morphixlivekiosk/templates/kiosk-builder-settings.xml 2007-10-17 19:55:14 UTC (rev 2569)
+++ trunk/morphixlivekiosk/templates/kiosk-builder-settings.xml 2007-10-18 21:42:36 UTC (rev 2570)
@@ -4,6 +4,7 @@
<morphix>
<base>http://surfnet.dl.sourceforge.net/sourceforge/morphix/MorphixBase-0.5-pre6.iso</base>
<mainmodule>http://www.barwap.com/morphix/livekiosk/MorphixLiveKiosk.mod</mainmodule>
+ <kioskminipre>http://morphix.svn.sourceforge.net/viewvc/*checkout*/morphix/trunk/scripts-mini/MorphixMini-KioskSetting.xml.pre</kioskminipre>
<minilist>
<MiniModule>http://morphix.svn.sourceforge.net/viewvc/*checkout*/morphix/trunk/scripts-mini/MorphixMini-NonFree-FlashPlugin.xml</MiniModule>
<MiniModule>http://morphix.svn.sourceforge.net/viewvc/*checkout*/morphix/trunk/scripts-mini/MorphixMini-NonFree-Java.xml</MiniModule>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/