[Debian-live-changes] r1291 - dists/trunk/live-webbuilder
Richard Nelson
rjent-guest at alioth.debian.org
Sun May 6 02:44:07 UTC 2007
Author: rjent-guest
Date: 2007-05-06 02:44:07 +0000 (Sun, 06 May 2007)
New Revision: 1291
Added:
dists/trunk/live-webbuilder/webbuilder-cron
Modified:
dists/trunk/live-webbuilder/live-webbuilder
Log:
webbuilder-cron and other minor changes.
Modified: dists/trunk/live-webbuilder/live-webbuilder
===================================================================
--- dists/trunk/live-webbuilder/live-webbuilder 2007-05-06 00:12:26 UTC (rev 1290)
+++ dists/trunk/live-webbuilder/live-webbuilder 2007-05-06 02:44:07 UTC (rev 1291)
@@ -21,8 +21,8 @@
# can be found in /usr/share/common-licenses/GPL file.
# Set some global the parameters
-VERSION="0.2.4"
-WORK_PATH="/tmp"
+VERSION="0.2.5"
+TEMPDIR="/tmp"
HTML="/usr/share/live-webbuilder/html"
# Send the HTTP headers
@@ -73,13 +73,13 @@
# Set the variables to pass to the cron job
# for processing.
#echo "`whoami`"
- echo "BUILD_ID=\"${BUILD_ID}\"" > "${WORK_PATH}/${BUILD_ID}".lwb
- echo "EMAIL=\"${EMAIL}\"" >> "${WORK_PATH}/${BUILD_ID}".lwb
- echo "BINARY_IMAGE=\"${BINARY_IMAGE}\"" >> "${WORK_PATH}/${BUILD_ID}".lwb
- echo "DISTRIBUTION=\"${DISTRIBUTION}\"" >> "${WORK_PATH}/${BUILD_ID}".lwb
- echo "FILESYSTEM=\"${FILESYSTEM}\"" >> "${WORK_PATH}/${BUILD_ID}".lwb
- echo "PACKAGES_LISTS=\"${PACKAGES_LISTS}\"" >> "${WORK_PATH}/${BUILD_ID}".lwb
- echo "PACKAGES=\"${PACKAGES}\"" >> "${WORK_PATH}/${BUILD_ID}".lwb
+ echo "BUILD_ID=\"${BUILD_ID}\"" > "${TEMPDIR}/${BUILD_ID}".lwb
+ echo "EMAIL=\"${EMAIL}\"" >> "${TEMPDIR}/${BUILD_ID}".lwb
+ echo "BINARY_IMAGE=\"${BINARY_IMAGE}\"" >> "${TEMPDIR}/${BUILD_ID}".lwb
+ echo "DISTRIBUTION=\"${DISTRIBUTION}\"" >> "${TEMPDIR}/${BUILD_ID}".lwb
+ echo "FILESYSTEM=\"${FILESYSTEM}\"" >> "${TEMPDIR}/${BUILD_ID}".lwb
+ echo "PACKAGES_LISTS=\"${PACKAGES_LISTS}\"" >> "${TEMPDIR}/${BUILD_ID}".lwb
+ echo "PACKAGES=\"${PACKAGES}\"" >> "${TEMPDIR}/${BUILD_ID}".lwb
# Below is a rough example for reference only.
#{ make-live -r ${WOKR_PATH}${BUILD_ID} --mirror-build ${MIRROR_BUILD} --packages-lists ${PACKAGES_LISTS} --binary-image ${BINARY_IMAGE} --distibution ${DISTRIBUTION} --filesystem ${FILESYSTEM} --packages "${PACKAGES}"; echo "Returned $? at $(date)"; } 2>&1 | mail -s "Your debian-live build with id - ${BUILD_ID}" ${EMAIL}
Added: dists/trunk/live-webbuilder/webbuilder-cron
===================================================================
--- dists/trunk/live-webbuilder/webbuilder-cron 2007-05-06 00:12:26 UTC (rev 1290)
+++ dists/trunk/live-webbuilder/webbuilder-cron 2007-05-06 02:44:07 UTC (rev 1291)
@@ -0,0 +1,87 @@
+#!/bin/sh -x
+
+# webbuilder-cron - cron for live-webbuilder a web-interface to make-live
+# Copyright (C) 2007 Richard Nelson <rjent at rjent.pair.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# On Debian systems, the complete text of the GNU General Public License
+# can be found in /usr/share/common-licenses/GPL file.
+
+set -e
+
+# Set some global parameters
+DESTDIR="/var/www/live-webbuilder"
+TEMPDIR="/tmp"
+MIRROR="http://localhost/debian/"
+MIRROR_IMAGE="http://localhost/debian/"
+MIRROR_SECURITY="http://ftp.us.debian.org/debian-security/"
+
+# Check for webbuilder-cron.sh already running
+if [ ! -f "${TEMPDIR}"/lwb-lock ]
+then
+ touch "${TEMPDIR}"/lwb-lock
+else
+ echo "E: webbuilder-cron.sh already running according to lock file."
+ exit 1
+fi
+
+# The LWB_LIST is the listing of live-webbuilder files waiting
+LWB_LIST="`ls "${TEMPDIR}"/*.lwb`"
+
+# Ok from here spin through the live-webbuilder files we have waiting to build
+for LWB in ${LWB_LIST}
+do
+ if [ -f "${LWB}" ]
+ then
+ # Pull in the meta file
+ . "${LWB}"
+ # Below are the current values that are expected to be their.
+ #echo ${BUILD_ID}
+ #echo ${EMAIL}
+ #echo ${BINARY_IMAGE}
+ #echo ${DISTRIBUTION}
+ #echo ${FILESYSTEM}
+ #echo ${PACKAGES_LISTS}
+ #echo ${PACKAGES}
+
+ # Below is where we try to put is all together.
+ { make-live --root "${DESTDIR}"/${BUILD_ID} --mirror-build ${MIRROR} --mirror-image ${MIRROR_IMAGE} --packages-lists ${PACKAGES_LISTS} --binary-image ${BINARY_IMAGE} --distribution ${DISTRIBUTION} --filesystem ${FILESYSTEM} --packages "${PACKAGES}"; echo "Returned $? at $(date)"; } 2>&1 | mail -s "Your debian-live build with id - ${BUILD_ID}" ${EMAIL}
+
+ # Move the .lwb file to the target so we do not try to rebuild later
+ mv "${LWB}" "${DESTDIR}"/${BUILD_ID}
+
+ # Do cleanup after
+ #cd "${DESTDIR}"/${BUILD_ID}
+ #lh_clean
+
+ # Unmount some things if still around
+ if [ -e "${DESTDIR}"/${BUILD_ID}/chroot/proc/version ]
+ then
+ umount "${DESTDIR}"/${BUILD_ID}/chroot/proc
+ fi
+
+ if [ -d "${DESTDIR}"/${BUILD_ID}/chroot/sys/kernel ]
+ then
+ umount "${DESTDIR}"/${BUILD_ID}/chroot/sys
+ fi
+
+ fi
+done
+
+# Remove the lock file if we get here.
+rm "${TEMPDIR}"/lwb-lock
+
+
Property changes on: dists/trunk/live-webbuilder/webbuilder-cron
___________________________________________________________________
Name: svn:executable
+ *
More information about the Debian-live-changes
mailing list