commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r6432 - in trunk/www/utils: . sbin


From: gnue
Subject: r6432 - in trunk/www/utils: . sbin
Date: Thu, 30 Sep 2004 12:59:30 -0500 (CDT)

Author: gnue
Date: 2004-09-30 12:59:29 -0500 (Thu, 30 Sep 2004)
New Revision: 6432

Added:
   trunk/www/utils/sbin/
   trunk/www/utils/sbin/README
   trunk/www/utils/sbin/create-epydocs
   trunk/www/utils/sbin/create-nightlies
   trunk/www/utils/sbin/update-tasks
Log:
Moved the nightly ash scripts to svn

Added: trunk/www/utils/sbin/README
===================================================================
--- trunk/www/utils/sbin/README 2004-09-30 16:29:57 UTC (rev 6431)
+++ trunk/www/utils/sbin/README 2004-09-30 17:59:29 UTC (rev 6432)
@@ -0,0 +1,2 @@
+These scripts are run locally on ash by the "gnue" user. 
+

Added: trunk/www/utils/sbin/create-epydocs
===================================================================
--- trunk/www/utils/sbin/create-epydocs 2004-09-30 16:29:57 UTC (rev 6431)
+++ trunk/www/utils/sbin/create-epydocs 2004-09-30 17:59:29 UTC (rev 6432)
@@ -0,0 +1,101 @@
+#!/bin/sh 
+
+umask 002 
+
+export BASE=/usr/local/gnue-sandbox
+export CHECKOUT=${BASE}/svn/gnue
+export INSTALLED=${CHECKOUT}/gnue-common/.cvsdevelbase
+
+tool=$1
+SRC=${INSTALLED}/gnue/$tool
+
+if [ "$tool" = "" ]
+then 
+  echo "Syntax: $0 <tool>"
+fi 
+  
+
+TMPDIR=/tmp/epydoc-$tool-$$
+DESTDIR=/var/www/tools/$tool/docs/api
+
+
+
+mkdir -p $DESTDIR/public $DESTDIR/private $TMPDIR
+
+epydoc --html -q -o $TMPDIR ${SRC}
+
+##  epydoc --pdf -q -o /var/www/tools/docs/$tool/api.pdf ${SRC}
+
+echo
+
+rm $TMPDIR/*/index.html 
+
+for t in public private
+do
+( 
+echo "Converting to PHP ($t)"
+
+cd $TMPDIR/$t
+curstuff=`echo $t|tr p P`
+
+for f in *.html
+do
+
+
+dest=${DESTDIR}/$t/`echo $f|sed 's/html$/php/g'`
+(
+  echo -n '<?php $TITLE="'"gnue.$tool ${curstuff}"' API"; ?>'
+
+  cat $CHECKOUT/www/misc/epydoc/header.php
+
+  cat "$TMPDIR/$t/$f"  | 
+     tail +11  |
+     grep -v '</body>' |
+     grep -v '</html>' |
+     grep -v 'no&nbsp;frame' |
+     sed -r 's/\.html(.*)">/.php\1">/g;s/<a target="[^"]*"/<a/g'    
+  
+  cat $CHECKOUT/www/misc/epydoc/footer.php
+
+) > "$dest"
+
+done
+
+python << EOF
+
+import glob, string
+
+sortable = []
+
+for f in glob.glob('gnue.${tool}*-module.html'):
+  if len(string.split(f,'.')) in (3,4):
+    name=f.split('-')[0]
+    if len(string.split(name,'.')) == 2: 
+      sortable.append((name.lower(),'<li><a href="%s">%s</a>\n<ul>' % 
(f.replace('.html','.php'), name)))
+    else:
+      sortable.append((name.lower(),'<li><a href="%s">%s</a></li>\n' % 
(f.replace('.html','.php'), name.split('.')[-1])))
+
+
+out = open('$DESTDIR/$t/_extra_menu.php','w')
+out.write('<h3><a href="index.php">${curstuff} API</a></h3>\n\n')
+out.write('<ul>')
+sortable.sort()
+for name, text in sortable:
+  out.write(text)
+
+out.write('</ul></li></ul>')
+
+out.write('<ul><li><a href="index.php">Module Heirarchy</a></li>')
+out.write('<li><a href="toc.php">Table of Contents</a></li></ul>')
+
+out.close()
+
+EOF
+
+
+(cd $DESTDIR/$t; ln -f -s trees.php index.php)
+
+)
+done
+
+rm -rf $TMPDIR 2>&1


Property changes on: trunk/www/utils/sbin/create-epydocs
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/www/utils/sbin/create-nightlies
===================================================================
--- trunk/www/utils/sbin/create-nightlies       2004-09-30 16:29:57 UTC (rev 
6431)
+++ trunk/www/utils/sbin/create-nightlies       2004-09-30 17:59:29 UTC (rev 
6432)
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+umask 002
+
+export BASE=/usr/local/gnue-sandbox
+export CHECKOUT=${BASE}/svn/gnue
+export INSTALLED=${CHECKOUT}/gnue-common/.cvsdevelbase
+export PATH="$PATH:$BASE/bin"
+
+tool=$1
+
+if [ "$tool" = "" ]
+then
+  echo "Syntax: $0 <tool>"
+fi
+
+cd ${CHECKOUT}/gnue-$tool
+
+rm -f dist/* 2>&1 > /dev/null
+
+GNUE_VERSION_SUFFIX="+svn.`date +'%Y%m%d'`" $BASE/bin/gcvs setup.py sdist 
--formats="gztar,zip"
+mv dist/* /var/www/downloads/snapshots/


Property changes on: trunk/www/utils/sbin/create-nightlies
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/www/utils/sbin/update-tasks
===================================================================
--- trunk/www/utils/sbin/update-tasks   2004-09-30 16:29:57 UTC (rev 6431)
+++ trunk/www/utils/sbin/update-tasks   2004-09-30 17:59:29 UTC (rev 6432)
@@ -0,0 +1,175 @@
+#!/bin/bash
+#
+# Syntax: $0 [--docs] [--nightlies] [--mailto email]
+#
+#    --docs       Create the epydoc documentation (time/cpu intensive)
+#    --nightlies  Create the nightly tarball installations of our tools
+#    --mailto     Specifies an email address to email output to
+#    --checkout   Checks out a new version of the svn repository instead of 
updating
+#
+#
+
+umask 002
+
+## Create a lockfile...
+
+export BASE=/usr/local/gnue-sandbox
+export CHECKOUT=${BASE}/svn/gnue
+export INSTALLED=${CHECKOUT}/.cvsdevelbase
+#export INSTALLED=${CHECKOUT}/gnue-common/.cvsdevelbase
+
+export NIGHTLIESLOG=/var/www/downloads/snapshots/build.txt
+
+export OUTFILE="/dev/tty"
+export LOGLIST=/tmp/update-website.logs.$$
+export LOCKFILE=/var/spool/update-website/DO-NOT-REMOVE.update-tasks
+echo -n > $LOGLIST
+
+while [ "$1" != "" ]
+do
+  case "$1" in 
+     --docs)
+       DOCS="yes"
+       ;;
+     --nightlies)
+       NIGHTLIES="yes"
+       date > $NIGHTLIESLOG  # Start our build log
+       # Remove archives older than 5 days
+       rm -f `find /var/www/downloads/snapshots/*-*.* -ctime +5` >/dev/null 
2>&1
+       ;;
+     --mailto)
+       shift
+       MAILTO="$1"
+       if [ "$1" = "" ]
+       then 
+         echo "--mailto expects an email address"
+        exit 1
+       fi
+       OUTFILE="/tmp/update-website.$$"
+       ;;
+     --checkout)
+       RECHECKOUT="yes"
+       ;;
+  esac 
+  shift
+done
+
+(
+
+echo "Checking for a lockfile"
+lockfile-create $LOCKFILE
+(while :; do lockfile-touch $LOCKFILE; sleep 60; done) 2>/dev/null &
+# Save the PID of the lockfile-touch process
+BADGER=$!
+
+
+#
+# Get our svn copy up-to-date
+#
+if [ "$RECHECKOUT" = "yes" ]
+then 
+ echo "Checking out svn"
+ rm -rf ${CHECKOUT}
+ svn co --non-interactive file:///var/svn/gnue/trunk ${CHECKOUT}
+else
+ SVNUPDATE="svn update --non-interactive"
+ SVNCLEANUP="svn cleanup"
+ echo Updating svn...
+ # Autogenerated stuff that gets in the way
+ cd ${CHECKOUT}
+ rm -f */po/*.po* 2>&1 > /dev/null
+ svn cleanup
+ # in case any svn signal flags were set:
+ rm -f /var/spool/update-website/signal-* 2>&1
+ # Try to update. If that fails, svn clean and try again...
+ ($SVNUPDATE || (echo "  (*) Running SVN Cleanup"; $SVNCLEANUP && $SVNUPDATE) 
) || (echo "  (*) Unable to svn update.")
+fi 
+#
+# Run setup-cvs.py to get a working install in /usr/local/gnue-sandbox/
+#
+rm -rf ${BASE}/gnue ${BASE}/bin/*
+echo "Running setup.py..."
+cd ${CHECKOUT}/gnue-common
+HOME=${BASE} ./setup-cvs.py --auto  2>&1 | sed 's/^/  (*) /g'
+
+
+# Update the website based on gnue/www/
+echo "Updating website..."
+cd ${CHECKOUT}/www
+$BASE/bin/gcvs utils/create-website --update --dest /var/www/ --htdig 
/etc/htdig/ --twiki /var/lib/twiki/templates/   2>&1 | sed 's/^/  (*) /g'
+
+#
+# Create docs
+#
+cd ${BASE}
+for tool in `(cd ${INSTALLED}/gnue; ls|grep -v '\.')`
+do
+ SRC=${INSTALLED}/gnue/${tool}
+  echo -n "Performing tasks for ${tool}..."
+  
+  #
+  # Epydoc
+  #
+  if [ "$DOCS" = 'yes' ]
+  then 
+    echo -n " (epydoc)"
+    (/usr/local/gnue-sandbox/sbin/create-epydocs ${tool}) > 
/tmp/epydoc-${tool}-$$.out 2>&1 
+    echo /tmp/epydoc-${tool}-$$.out >> $LOGLIST
+  fi 
+
+  #
+  # technotes
+  #
+  echo -n " (technotes)"
+  TNDEST=/var/www/tools/${tool}/docs/technotes
+  mkdir -p $TNDEST 2>/dev/null
+  cp ${CHECKOUT}/gnue-${tool}/doc/technotes/* $TNBASE 2>/dev/null
+  (cd $TNDEST && python ${CHECKOUT}/gnue-common/utils/create-technote-index.py)
+
+  # 
+  # Nightlies
+  #
+  if [ "$NIGHTLIES" = 'yes' ]
+  then
+    log=/tmp/nightlies-${tool}-$$.out
+    echo -n " (nightlies)"
+    (
+       /usr/local/gnue-sandbox/sbin/create-nightlies ${tool}
+    ) > $log 2>&1 
+    echo $log >> $LOGLIST
+    (echo; echo
+     echo 
"-------------------------------------------------------------------------------"
+     echo "Nightly build log for gnue-$tool"
+     echo 
"-------------------------------------------------------------------------------"
+     cat $log ) >> $NIGHTLIESLOG
+  fi
+
+  echo
+
+done
+
+kill ${BADGER} 2>/dev/null
+lockfile-remove $LOCKFILE
+
+) > $OUTFILE  2>&1
+
+
+
+# Cleanup/Mail logs
+if [ "$MAILTO" != "" ]
+then 
+  for file in `cat $LOGLIST`
+  do
+    muttarg="$muttarg -a $file"
+  done
+  (cat $OUTFILE|/usr/bin/mutt -s "GNUe update-website (`date +'%Y-%m-%d 
%H:%M:%S'`)" $muttarg $MAILTO) && rm -f `cat $LOGLIST` $LOGLIST 
+else
+  if [ -s "$LOGLIST" ]
+  then 
+    echo
+    echo "The following logfiles were created. They will be kept for 5 days"
+    cat $LOGLIST|sed 's/^/  - /g'
+  fi 
+  rm -f $LOGLIST
+fi 
+


Property changes on: trunk/www/utils/sbin/update-tasks
___________________________________________________________________
Name: svn:executable
   + *





reply via email to

[Prev in Thread] Current Thread [Next in Thread]