contrib/testing/testbuilder: Update to 0.6.1
authorYuri Bushmelev <jay4mail@gmail.com>
Wed, 16 Mar 2011 22:54:39 +0000 (01:54 +0300)
committerYuri Bushmelev <jay4mail@gmail.com>
Wed, 16 Mar 2011 22:54:39 +0000 (01:54 +0300)
contrib/testing/testbuilder/testbuilder
contrib/testing/testbuilder/testbuilder.conf.sample

index 5d9e023..348d811 100755 (executable)
@@ -12,7 +12,7 @@
 # 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.
-VERSION="0.6"
+VERSION="0.6.1"
 PACKAGE="TestBuilder"
 
 TB_DIR=`dirname $0`
@@ -210,7 +210,7 @@ tb_build_images() {
        touch "${_log}"
 
        _stime=$(date +%s)
-       ${BB_CMD} ${BB_OPTS} ${_images} 2>&1 | tee "${_log}"
+       eval ${BB_CMD} ${BB_OPTS} ${_images} 2>&1 | tee "${_log}"
        _rc=$?
        _btime=$( TZ=UTC0 date -d "now - $_stime seconds" '+%T' )
 
@@ -274,7 +274,7 @@ tb_build_machines() {
 ### Main code 
 
 # Parse stages
-unset DO_RUN_BUILDS DO_UPDATE_OE DO_UPDATE_BB
+unset DO_RUN_BUILDS DO_UPDATE_OE DO_UPDATE_BB DO_UPLOAD_LOGS
 for stage in $STAGES; do
        [ "${stage}" != "${stage#!}" ] && continue
        case ${stage} in
@@ -284,6 +284,8 @@ for stage in $STAGES; do
                DO_UPDATE_OE=y;;
        'update_bb')
                DO_UPDATE_BB=y;;
+       'upload_logs')
+               DO_UPLOAD_LOGS=y;;
        *)
                tb_log "Unknown stage ${stage}.";;
        esac
@@ -500,6 +502,12 @@ for buildconf in ${BUILDS}; do (
        done #DISTROS
 ) done #BUILDS
 
+# Upload logs
+if [ -n "$DO_UPLOAD_LOGS" ]; then
+       tb_log "Uploading logs to ${UPLOAD_DESTDIR}"
+       eval ${UPLOAD_CMD} ${UPLOAD_OPTS} "${LOG_DIR}/*" "${UPLOAD_DESTDIR}"
+fi
+
 tb_log "All done."
 
 exit 0
index 17dc08c..b588407 100644 (file)
@@ -12,7 +12,8 @@
 # update_bb - update bitbake git tree
 # update_oe - update OE git tree
 # run_builds - run builds
-STAGES="update_bb update_oe !run_builds"
+# upload_logs - upload logs to some other place
+STAGES="update_bb update_oe !run_builds !upload_logs"
 
 ## ACCOUNTING: account some useful things
 # df - log free disk space
@@ -57,6 +58,14 @@ MW_USER=""
 # Build host machine
 # HOST_MACHINE="<cpu model, cores @freq> /<RAM amount>"
 
+## UPLOAD
+# Upload command
+UPLOAD_CMD="rsync"
+# Upload options
+UPLOAD_OPTS="-av --delete"
+# Upload destination
+UPLOAD_DESTDIR="${TB_BUILDER}@server:/var/www/htdocs/testbuilder/logs"
+
 # Misc dirs
 TB_BASE=`pwd`
 BB_DIR="${TB_BASE}/bitbake"