]> git.pond.sub.org Git - empserver/commitdiff
Add server.log and journal.log to nightly build
authorRon Koenderink <rkoenderink@yahoo.ca>
Sun, 24 Aug 2008 15:09:22 +0000 (09:09 -0600)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sun, 24 Aug 2008 15:09:22 +0000 (09:09 -0600)
Turn on journaling using journal.econfig.
Append the server.log and journal.log files
to the nightly build log in the SERVERSTOP step.
Remove the server.log and journal.log in the
SERVERSTART step to ensure only this run's log
events are included in the nightly build log.
Add the construction of a econfig in the
generate step using *.econfig in the patches
directory in a same way code patches are applied.
The mingw.patch was removed and replaced with the
mingw.econfig.  The mingw.econfig also required
the addition of exports to the win32.i386.config.

src/scripts/nightly/conf/win32.i386.config
src/scripts/nightly/nightlybuild.sh
src/scripts/nightly/patches/All/journal.econfig [new file with mode: 0644]
src/scripts/nightly/patches/win32.i386/mingw.econfig [new file with mode: 0644]
src/scripts/nightly/patches/win32.i386/mingw.patch [deleted file]

index 920360a31dde9b2ba2b68d9488f802fe0ee6e83f..3c293ca1869ee1e20dc3eb0ad4bea83475762984 100644 (file)
@@ -1,9 +1,10 @@
 SCRIPTDIR=/home/empire
-BOXDIR=boxes
+export BOXDIR=boxes
 LOGDIR=logs
-INSTANCE=win32.i386
+export INSTANCE=win32.i386
 EMPPORT=8889
 NIGHTLY_SKIP_STEP=
 GITROOT=ssh://ron-VM2/~empire/empserver.git
 PATH=$PATH:/c/Progra~1/git/bin
+export MINGW_DIR="c:/MinGW"
 
index 9885eda6083e6deb52555070925e0aaa832e3976..0da030949346237917bab8c0c03ae47b8333be70 100755 (executable)
@@ -227,6 +227,49 @@ do
                break
        fi
 
+       if [ ! -f emp4/etc/empire/econfig ]
+       then
+               warn "econfig file is missing"
+               break
+       fi
+
+       if ! emp4/sbin/pconfig >emp4/etc/empire/econfig
+       then
+               warn "pconfig failed to create econfig file"
+               break
+       fi
+echo "Applying global econfig patches from ${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/All"
+for i in "${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/All"/*.econfig
+do
+       [ -r "${i}" ] || continue
+       if "${i}" >>emp4/etc/empire/econfig
+       then
+               echo "${i}: OK"
+       else
+               echo "========== ${i}: NOT OK! ${?} =========="
+       fi
+done
+echo "Done (econfig patch All)."
+echo ""
+
+LOCALPATCHDIRECTORY="${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/${INSTANCE}"
+if [ -n "${LOCALPATCHDIRECTORY}" -a -d "${LOCALPATCHDIRECTORY}/." ]
+then
+       echo "Applying system specific econfig patches from ${LOCALPATCHDIRECTORY}:"
+       for i in "${LOCALPATCHDIRECTORY}"/*.econfig
+       do
+               [ -r "${i}" ] || continue
+               if "${i}" >>emp4/etc/empire/econfig
+               then
+                       echo "${i}: OK"
+               else
+                       echo "========== ${i}: NOT OK! ${?} =========="
+               fi
+       done
+       echo "Done (econfig patch specific)."
+       echo ""
+fi
+
        cd emp4/bin || err "Could not cd to emp4/bin"
 
        echo "Determining type of files in bin directory"
@@ -242,8 +285,8 @@ do
        echo ""
 
        echo "Running files and fairland"
-       echo y | ./files || warn "Error running files"
-       ./fairland -R 1 10 30 >/dev/null || { warn "Error running fairland" ; break ; }
+       echo y | ./files -e ../etc/empire/econfig || warn "Error running files"
+       ./fairland -R 1 -e ../etc/empire/econfig 10 30 >/dev/null || { warn "Error running fairland" ; break ; }
        [ -s "newcap_script" ] || { warn "fairland did not produce newcap_script" ; break ; }
        echo "Done (files & fairland)."
        echo ""
@@ -262,8 +305,17 @@ do
                *SERVERSTART*) ;;
                *)
 
+       echo "Removing existing server.log and journal.log"
+       if [ -f "../var/empire/server.log" ] 
+       then
+           rm "../var/empire/server.log"
+       fi
+       if [ -f "../var/empire/journal.log" ] 
+       then
+           rm "../var/empire/journal.log"
+       fi
        echo "Starting server with -d in the background"
-       ./emp_server -R 1 -d &
+       ./emp_server -R 1 -e ../etc/empire/econfig -d 2>/dev/null &
        PID="$!"
        sleep 1
        kill -0 "${PID}" || { warn "emp_server not running ?" ; break ; }
@@ -995,7 +1047,14 @@ EOF
        echo "Stopping server"
        trykill "${PID}"
        echo "Done (kill)."
-       echo ""
+cd "${BOXDIR}/${WORKDIR}/emp4/var/empire" || err "Could not cd to ${BOXDIR}/${WORKDIR}/emp4/var/empire"
+       echo "-- Start Server Log --"
+       cat server.log 
+       echo "-- End of Server Log --"
+       echo "-- Start Journal Log --"
+       cat journal.log 
+       echo "-- End of Journal Log --"
+       echo "Server stopped"
                                        ;;
                        esac
                        ;;
diff --git a/src/scripts/nightly/patches/All/journal.econfig b/src/scripts/nightly/patches/All/journal.econfig
new file mode 100644 (file)
index 0000000..4ae40f3
--- /dev/null
@@ -0,0 +1 @@
+echo keep_journal 1
diff --git a/src/scripts/nightly/patches/win32.i386/mingw.econfig b/src/scripts/nightly/patches/win32.i386/mingw.econfig
new file mode 100644 (file)
index 0000000..17e25c9
--- /dev/null
@@ -0,0 +1,3 @@
+echo data "$MINGW_DIR$BOXDIR/$INSTANCE/emp4/var/empire"
+echo info "$MINGW_DIR$BOXDIR/$INSTANCE/emp4/share/empire/info.nr"
+echo builtin "$MINGW_DIR$BOXDIR/$INSTANCE/emp4/share/empire/builtin"
diff --git a/src/scripts/nightly/patches/win32.i386/mingw.patch b/src/scripts/nightly/patches/win32.i386/mingw.patch
deleted file mode 100644 (file)
index 16530f7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-diff --git a/src/lib/global/path.c.in b/src/lib/global/path.c.in
-index a761735..77b9c50 100644
---- a/src/lib/global/path.c.in
-+++ b/src/lib/global/path.c.in
-@@ -38,7 +38,7 @@
- #include "optlist.h"
- /* econfig file to try when user doesn't specify one */
--char dflt_econfig[] = "@econfig@";
-+char dflt_econfig[] = "c:/MinGW@econfig@";
- /*
-  * Where to find configuration (absolute file name)
-@@ -53,17 +53,17 @@ char *custom_tables = "";
- char *schedulefil;
- /* Where to find built-in configuration tables (relative to configdir) */
--char *builtindir_conf = "@builtindir@";
-+char *builtindir_conf = "c:/MinGW@builtindir@";
- /* Where to find built-in configuration tables (absolute) */
- char *builtindir;
- /* Where to find info pages (relative to configdir) */
--char *infodir_conf = "@einfodir@";
-+char *infodir_conf = "c:/MinGW@einfodir@";
- /* Where to find info pages (absolute) */
- char *infodir;
- /* Where this game's data is stored (relative to configdir) */
--char *gamedir_conf = "@gamedir@";
-+char *gamedir_conf = "c:/MinGW@gamedir@";
- /* Where this game's data is stored (absolute) */
- char *gamedir;