svn: /web/doc-editor/trunk/scripts/cron/ check_build.php

From: Date: Mon, 05 Apr 2010 20:05:57 +0000
Subject: svn: /web/doc-editor/trunk/scripts/cron/ check_build.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-1740@lists.php.net to get a copy of this message
yannick Mon, 05 Apr 2010 20:05:57 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=297541 Log: Fix App name ; Only display the first 20 lines of the log build ; Script all projects others than PHP Changed paths: U web/doc-editor/trunk/scripts/cron/check_build.php Modified: web/doc-editor/trunk/scripts/cron/check_build.php =================================================================== --- web/doc-editor/trunk/scripts/cron/check_build.php 2010-04-05 19:58:39 UTC (rev 297540) +++ web/doc-editor/trunk/scripts/cron/check_build.php 2010-04-05 20:05:57 UTC (rev 297541) @@ -1,3 +1,4 @@ +#!/usr/bin/env php <?php /*** @@ -4,7 +5,7 @@ * This script is intended to be placed in a cronjob. * It must be run every Thursday, at 01hOO for example. * On Unix, you can use crontab -e and place this : -* 00 01 * * 4 /usr/bin/php /path/to/your/vcs/dir/doc-editor/scripts/cron/check_build.php +* 00 01 * * 4 /path/to/your/vcs/dir/doc-editor/scripts/cron/check_build.php ****/ require_once dirname(__FILE__) . '/../../php/Conf.php'; @@ -19,8 +20,13 @@ while( list($key, $project) = each($availableProject) ) { -echo "enter into ".$project['code']."\n"; + // Actually, only PHP project support to be automatically checked for the build. Skip all others projects + if( $project['code'] != "php" ) { + continue; + } + echo "enter into ".$project['code']."\n"; + // We must delete this var to be re-generated unset($rm->existingLanguage); @@ -48,6 +54,9 @@ // What we must do when the build failed if( $return["state"] == "ko" ) { + // We put into mail only 20 lines + $return["logContent"] = array_slice($return["logContent"], 0, 20); + $msg = "Your documentation is broken. The build is done on Friday. Please, try to fix it *quickly*. @@ -59,7 +68,7 @@ ".implode("\n", $return["logContent"])." -- - This email is send automatically by the PhpDocumentation Online Editor. + This email is send automatically by the Php Docbook Online Editor. "; $to = "doc-$lang@lists.php.net"; @@ -69,6 +78,7 @@ // We send an email for this failed build AccountManager::getInstance()->email($to, $subject, $msg, 'www'); + echo "email send !\n"; // We store it into DB LogManager::getInstance()->saveFailedBuild($lang, $return["logContent"]);

« previous php.doc.web (#1740) next »