Index: trunk/ATTIC/test-server/scripts/move_logs.php |
— | — | @@ -0,0 +1,77 @@ |
| 2 | +<?php |
| 3 | +/* |
| 4 | + * This script moves all old cruisecontrol logs that it finds into an archive directory. |
| 5 | + * TODO: Make this a cron job on the ci server |
| 6 | + */ |
| 7 | + |
| 8 | +#main |
| 9 | +$options = getopt( 'c:l:h', array( 'ccdir:', 'logArchive', 'help' ) ); |
| 10 | + |
| 11 | +if ( isset( $options['h'] ) ) { |
| 12 | + usage(); |
| 13 | + exit(0); |
| 14 | +} |
| 15 | + |
| 16 | +if ( !isset( $options['c'] ) ) { |
| 17 | + exitOnError( 'Missing required argument -c', true ); |
| 18 | +} |
| 19 | +if ( !isset( $options['l'] ) ) { |
| 20 | + exitOnError( 'Missing required argument -l', true ); |
| 21 | +} |
| 22 | + |
| 23 | +$ccDir = $options['c']; |
| 24 | +$ccLogDir = $ccDir . '/logs'; |
| 25 | +$logArchiveDir = $options['l']; |
| 26 | + |
| 27 | +if ( !is_readable( $ccDir ) ) { |
| 28 | + exitOnError( 'Could not read cruisecontrol home directory : ' . $ccDir ); |
| 29 | +} |
| 30 | +if ( !is_readable( $ccLogDir ) ) { |
| 31 | + exitOnError( 'Could not read cruisecontrol log directory : ' . $ccLogir ); |
| 32 | +} |
| 33 | + |
| 34 | +if ( !is_writable( $logArchiveDir ) ) { |
| 35 | + exitOnError( 'Could not write to the log archive destination : ' . $logArchiveDir ); |
| 36 | +} |
| 37 | + |
| 38 | +//create a subdirectory for this run. |
| 39 | +$newArchiveDir = $logArchiveDir . date('Y-m-d_G-i-s'); |
| 40 | +mkdir( $newArchiveDir ); |
| 41 | +//all logs archived by cruisecontrol |
| 42 | +$command = 'find ' . $ccLogDir . ' -type f -and -name "log*\.gz"'; |
| 43 | +findAndMove( $command, $newArchiveDir); |
| 44 | +//all old cruisecontrol run logs |
| 45 | +$command = 'find ' . $ccDir . ' -name "cruisecontrol\.log\.*"'; |
| 46 | +findAndMove( $command, $newArchiveDir); |
| 47 | + |
| 48 | +function usage() { |
| 49 | + $line = "Usage: php " . basename(__FILE__) . " -c CCHOMEDIR -l LOGARCHIVEDEST\n"; |
| 50 | + $line .= "-c, --ccdir=CCHOMEDIR Cruisecontrol home directory (assumes logs are under CCHOMEDIR/logs).\n"; |
| 51 | + $line .= "-l, --logArchive=LOGARCHIVEDEST Destination directory for the archived logs.\n"; |
| 52 | + $line .= "-h, --help This help message\n"; |
| 53 | + print $line; |
| 54 | +} |
| 55 | + |
| 56 | +function exitOnError( $errorMessage = '' , $showUsage = false ) { |
| 57 | + if ( strlen( $errorMessage ) > 0 ) { |
| 58 | + print "Error: " . $errorMessage . "\n"; |
| 59 | + } |
| 60 | + if ( $showUsage ) { |
| 61 | + usage(); |
| 62 | + } |
| 63 | + exit(1); |
| 64 | +} |
| 65 | + |
| 66 | +/* |
| 67 | + * Execute each command and move each file returned by $command into $archiveDir |
| 68 | + */ |
| 69 | +function findAndMove( $command, $archiveDir ) { |
| 70 | + $result = array(); |
| 71 | + exec($command, $result ); |
| 72 | + |
| 73 | + foreach ( $result as $logFile ) { |
| 74 | + $name = basename( $logFile ); |
| 75 | + rename( $logFile, $archiveDir . '/' . $name ); |
| 76 | + } |
| 77 | +} |
| 78 | + |
Index: trunk/ATTIC/test-server/cc-home/config.xml |
— | — | @@ -0,0 +1,58 @@ |
| 2 | +<?xml version="1.0"?>
|
| 3 | +<cruisecontrol>
|
| 4 | + <project name="mw">
|
| 5 | + <plugin name="svnbootstrapper"
|
| 6 | + classname="net.sourceforge.cruisecontrol.bootstrappers.SVNBootstrapper"/>
|
| 7 | + <plugin name="svn" classname="net.sourceforge.cruisecontrol.sourcecontrols.SVN"/>
|
| 8 | + <listeners>
|
| 9 | + <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
|
| 10 | + </listeners>
|
| 11 | + <bootstrappers>
|
| 12 | + <antbootstrapper anthome="apache-ant-1.7.0"
|
| 13 | + buildfile="projects/${project.name}/build.xml" target="clean"/>
|
| 14 | + </bootstrappers>
|
| 15 | + <modificationset quietperiod="300">
|
| 16 | + <!-- touch any file in connectfour project to trigger a build -->
|
| 17 | + <filesystem folder="projects/${project.name}/touchme"/>
|
| 18 | + <svn RepositoryLocation="http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3"/>
|
| 19 | + </modificationset>
|
| 20 | + <schedule interval="3600">
|
| 21 | + <ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/>
|
| 22 | + </schedule>
|
| 23 | + <log>
|
| 24 | + <merge dir="projects/${project.name}/build/logs"/>
|
| 25 | + <delete every="1" unit="WEEK" />
|
| 26 | + <gzip every="1" unit="DAY" />
|
| 27 | + <deleteartifacts every="1" unit="DAY" />
|
| 28 | + </log>
|
| 29 | + <publishers>
|
| 30 | + <!-- disable this till we write a script to delete old artifacts. It takes up too much disk space per build.
|
| 31 | + <onsuccess>
|
| 32 | + <artifactspublisher dir="projects/${project.name}/build/api"
|
| 33 | + dest="artifacts/${project.name}" subdirectory="api"/>
|
| 34 | + <artifactspublisher dir="projects/${project.name}/build/coverage"
|
| 35 | + dest="artifacts/${project.name}" subdirectory="coverage"/>
|
| 36 | + <artifactspublisher dir="projects/${project.name}/build/php-code-browser" dest="artifacts/${project.name}" subdirectory="php-code-browser"/>
|
| 37 | + </onsuccess>
|
| 38 | + -->
|
| 39 | +
|
| 40 | + <!-- <execute command="/usr/bin/phpuc graph logs/${project.name} artifacts/${project.name}"/> -->
|
| 41 | + <!--
|
| 42 | + Sends simple text emails after a project build. For nicer html emails,
|
| 43 | + checkout the original CruiseControl documentation.
|
| 44 | +
|
| 45 | +* http://cruisecontrol.sourceforge.net/main/configxml.html#email
|
| 46 | +* http://cruisecontrol.sourceforge.net/main/configxml.html#htmlemail
|
| 47 | + -->
|
| 48 | + <email mailhost="localhost"
|
| 49 | + returnaddress="cruise@phpundercontrol.org"
|
| 50 | + buildresultsurl="http://ci.tesla.usability.wikimedia.org:8080/cruisecontrol/buildresults/${project.name}"
|
| 51 | + skipusers="true" spamwhilebroken="true">
|
| 52 | + <failure address="mah@everybody.org"/>
|
| 53 | + </email>
|
| 54 | + <antpublisher anthome="apache-ant-1.7.0"
|
| 55 | + buildfile="projects/${project.name}/build.xml"
|
| 56 | + target="irc-publish"/>
|
| 57 | + </publishers>
|
| 58 | + </project>
|
| 59 | +</cruisecontrol>
|
Property changes on: trunk/ATTIC/test-server/cc-home/config.xml |
___________________________________________________________________ |
Added: svn:eol-syle |
1 | 60 | + native |
Index: trunk/ATTIC/test-server/cc-home/cruisecontrol.sh |
— | — | @@ -0,0 +1,112 @@ |
| 2 | +#!/usr/bin/env bash |
| 3 | + |
| 4 | +################################################################################ |
| 5 | +# CruiseControl, a Continuous Integration Toolkit |
| 6 | +# Copyright (c) 2001, ThoughtWorks, Inc. |
| 7 | +# 200 E. Randolph, 25th Floor |
| 8 | +# Chicago, IL 60601 USA |
| 9 | +# All rights reserved. |
| 10 | +# |
| 11 | +# Redistribution and use in source and binary forms, with or without |
| 12 | +# modification, are permitted provided that the following conditions |
| 13 | +# are met: |
| 14 | +# |
| 15 | +# + Redistributions of source code must retain the above copyright |
| 16 | +# notice, this list of conditions and the following disclaimer. |
| 17 | +# |
| 18 | +# + Redistributions in binary form must reproduce the above |
| 19 | +# copyright notice, this list of conditions and the following |
| 20 | +# disclaimer in the documentation and/or other materials provided |
| 21 | +# with the distribution. |
| 22 | +# |
| 23 | +# + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the |
| 24 | +# names of its contributors may be used to endorse or promote |
| 25 | +# products derived from this software without specific prior |
| 26 | +# written permission. |
| 27 | +# |
| 28 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 29 | +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 30 | +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 31 | +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR |
| 32 | +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 33 | +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 34 | +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 35 | +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 36 | +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 37 | +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 38 | +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 39 | +################################################################################ |
| 40 | + |
| 41 | +# CCDIR: The root of the CruiseControl directory. |
| 42 | +# The key requirement is that this is the parent |
| 43 | +# directory of CruiseControl's lib and dist directories. |
| 44 | +if [ -z "$CCDIR" ] ; then |
| 45 | + # resolve links - $0 may be a softlink |
| 46 | + PRG="$0" |
| 47 | + |
| 48 | + # need this for relative symlinks |
| 49 | + while [ -h "$PRG" ] ; do |
| 50 | + ls=`ls -ld "$PRG"` |
| 51 | + link=`expr "$ls" : '.*-> \(.*\)$'` |
| 52 | + if expr "$link" : '/.*' > /dev/null; then |
| 53 | + PRG="$link" |
| 54 | + else |
| 55 | + PRG=`dirname "$PRG"`"/$link" |
| 56 | + fi |
| 57 | + done |
| 58 | + |
| 59 | + saveddir=`pwd` |
| 60 | + |
| 61 | + CCDIR=`dirname "$PRG"` |
| 62 | + |
| 63 | + # make it fully qualified |
| 64 | + CCDIR=`cd "$CCDIR" && pwd` |
| 65 | + |
| 66 | + cd $saveddir |
| 67 | + echo Using Cruise Control at $CCDIR |
| 68 | +fi |
| 69 | + |
| 70 | +# Uncomment the following line if you have OutOfMemoryError errors |
| 71 | +CC_OPTS="-Xms1024m -Xmx1512m" |
| 72 | + |
| 73 | +#-------------------------------------------- |
| 74 | +# set JAVA_HOME on Mac OSX |
| 75 | +#-------------------------------------------- |
| 76 | +case "`uname -a`" in |
| 77 | + Darwin*) |
| 78 | + if [ -z "$JAVA_HOME" ] ; then |
| 79 | + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home |
| 80 | + fi |
| 81 | + ;; |
| 82 | + Linux*Ubuntu*) |
| 83 | + if [ -z "$JAVA_HOME" ] ; then |
| 84 | + JAVA_HOME=/usr |
| 85 | + fi |
| 86 | + ;; |
| 87 | +esac |
| 88 | + |
| 89 | + |
| 90 | +LIBDIR=$CCDIR/lib |
| 91 | +LAUNCHER=$LIBDIR/cruisecontrol-launcher.jar |
| 92 | +if [ -z "$JETTY_LOGS" ] ; then |
| 93 | + JETTY_LOGS=$CCDIR/logs |
| 94 | +fi |
| 95 | + |
| 96 | +# convert the existing path to unix |
| 97 | +if [ `uname | grep -n CYGWIN` ]; then |
| 98 | + JAVA_HOME=`cygpath --path --unix "$JAVA_HOME"` |
| 99 | +fi |
| 100 | + |
| 101 | +# convert the existing path to unix |
| 102 | +if [ `uname | grep -n CYGWIN` ]; then |
| 103 | + CRUISE_PATH=`cygpath --path --windows "$CRUISE_PATH"` |
| 104 | +fi |
| 105 | + |
| 106 | +if [ `uname | grep -n CYGWIN` ]; then |
| 107 | + LAUNCHER=`cygpath --windows "$LAUNCHER"` |
| 108 | +fi |
| 109 | + |
| 110 | +EXEC="$JAVA_HOME/bin/java $CC_OPTS -Djavax.management.builder.initial=mx4j.server.MX4JMBeanServerBuilder -Dcc.library.dir=$LIBDIR -Djetty.logs=$JETTY_LOGS -jar $LAUNCHER $@ -jmxport 8000 -webport 8080 -rmiport 1099" |
| 111 | +echo $EXEC |
| 112 | +$JAVA_HOME/bin/java $CC_OPTS -Djavax.management.builder.initial=mx4j.server.MX4JMBeanServerBuilder "-Dcc.library.dir=$LIBDIR" "-Djetty.logs=$JETTY_LOGS" -jar "$LAUNCHER" $@ -jmxport 8000 -webport 8080 -rmiport 1099 & |
| 113 | +echo $! > $CCDIR/cc.pid |
Property changes on: trunk/ATTIC/test-server/cc-home/cruisecontrol.sh |
___________________________________________________________________ |
Added: svn:executable |
1 | 114 | + * |
Index: trunk/ATTIC/test-server/cc-home/projects/mw/config.xml |
— | — | @@ -0,0 +1,17 @@ |
| 2 | +<?xml version="1.0" encoding="UTF-8"?> |
| 3 | +<project name="MediaWiki (trunk)" buildafterfailed="false"> |
| 4 | + <plugin name="svn" classname="net.sourceforge.cruisecontrol.sourcecontrols.SVN" /> |
| 5 | + <modificationset quietperiod="60"> |
| 6 | + <svn localWorkingCopy="projects/${project.name}/source/"/> |
| 7 | + </modificationset> |
| 8 | + <!-- put the build.xml under version control at a later point--> |
| 9 | + <!-- <bootstrappers> --> |
| 10 | + <!-- <svnbootstrapper localWorkingCopy="projects/${project.name}/source/" file="build.xml"/> --> |
| 11 | + <!-- </bootstrappers> --> |
| 12 | + <schedule interval="120"> |
| 13 | + <ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/> |
| 14 | + </schedule> |
| 15 | + <log dir="logs/${project.name}"> |
| 16 | + <merge dir="projects/${project.name}/build/logs/"/> |
| 17 | + </log> |
| 18 | +</project> |
Property changes on: trunk/ATTIC/test-server/cc-home/projects/mw/config.xml |
___________________________________________________________________ |
Added: svn:eol-syle |
1 | 19 | + native |
Index: trunk/ATTIC/test-server/cc-home/projects/mw/ExtraSettings.php |
— | — | @@ -0,0 +1,19 @@ |
| 2 | +<?php |
| 3 | +# This file will be included by LocalSettings.php |
| 4 | + |
| 5 | +$ext = dirname( __FILE__ ) . '/extensions'; |
| 6 | +require_once( "$ext/Cite/Cite.php" ); |
| 7 | +require_once( "$ext/CodeReview/CodeReview.php" ); |
| 8 | +require_once( "$ext/Gadgets/Gadgets.php" ); |
| 9 | +#require_once( "$ext/FlaggedRevs/FlaggedRevs.php" ); |
| 10 | +require_once( "$ext/LabeledSectionTransclusion/lst.php" ); |
| 11 | +require_once( "$ext/ParserFunctions/ParserFunctions.php" ); |
| 12 | +require_once( "$ext/Poem/Poem.php" ); |
| 13 | + |
| 14 | +$wgPFEnableStringFunctions = true; # fully test ParserFunctions |
| 15 | + |
| 16 | +$wgShowExceptionDetails = true; |
| 17 | +$wgShowSQLErrors = true; |
| 18 | +#$wgDebugLogFile = dirname( __FILE__ ) . '/build/debug.log'; |
| 19 | +$wgDebugDumpSql = true; |
| 20 | + |
Property changes on: trunk/ATTIC/test-server/cc-home/projects/mw/ExtraSettings.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 21 | + native |
Index: trunk/ATTIC/test-server/cc-home/projects/mw/build.properties |
— | — | @@ -0,0 +1,12 @@ |
| 2 | +builddir=${basedir}/build |
| 3 | +sourcedir=${basedir}/source |
| 4 | +extensionsdir=${basedir}/extensions |
| 5 | +apache.root=/var/www/irc |
| 6 | +svn.up.args=--ignore-externals |
| 7 | + |
| 8 | +# This is the part of the source checkout we're going to do things like PHPDoc, etc |
| 9 | +sourcepart=. |
| 10 | + |
| 11 | +javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl |
| 12 | + |
| 13 | + |
Index: trunk/ATTIC/test-server/cc-home/projects/mw/irc-publisher.xsl |
— | — | @@ -0,0 +1,49 @@ |
| 2 | +<?xml version="1.0" encoding="UTF-8"?> |
| 3 | +<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 4 | + xmlns:c="http://exslt.org/common" |
| 5 | + xmlns:fn="http://www.w3.org/2005/xpath-functions" |
| 6 | + xmlns:set="http://exslt.org/sets"> |
| 7 | + <xsl:param name="userinfo"/> |
| 8 | + |
| 9 | + <xsl:output |
| 10 | + method="text" |
| 11 | + encoding="UTF-8" /> |
| 12 | + |
| 13 | + <xsl:template match="/cruisecontrol/build[@error]">Something broke. See <http://ci.tesla.usability.wikimedia.org/cruisecontrol/>. |
| 14 | +<xsl:call-template name="get-last-modified"/> |
| 15 | + </xsl:template> |
| 16 | + |
| 17 | + <xsl:template name="get-last-modified"><xsl:text>Possible culprits: </xsl:text> |
| 18 | + <xsl:for-each select="set:distinct(c:node-set( |
| 19 | + /cruisecontrol/modifications/modification/user | |
| 20 | + /cruisecontrol/modifications/modification/revision))"> |
| 21 | + <xsl:if test="name() = 'user'"> |
| 22 | + <xsl:call-template name="irc-nick-lookup"> |
| 23 | + <xsl:with-param name="id"> |
| 24 | + <xsl:value-of select="."/> |
| 25 | + </xsl:with-param> |
| 26 | + </xsl:call-template> |
| 27 | + </xsl:if> |
| 28 | + <xsl:if test="name() = 'revision'">/r<xsl:value-of select="."/> |
| 29 | + <xsl:text> </xsl:text> |
| 30 | + </xsl:if> |
| 31 | + </xsl:for-each> |
| 32 | + </xsl:template> |
| 33 | + |
| 34 | + <xsl:template name="irc-nick-lookup"> |
| 35 | + <xsl:param name="id"/> |
| 36 | + <xsl:variable name="nick" |
| 37 | + select="document($userinfo)/userinfo/committer[@id=$id]/irc"/> |
| 38 | + <xsl:choose> |
| 39 | + <xsl:when test="$nick"> |
| 40 | + <xsl:value-of select="$nick"/> |
| 41 | + </xsl:when> |
| 42 | + <xsl:otherwise> |
| 43 | + <xsl:value-of select="$id"/> |
| 44 | + </xsl:otherwise> |
| 45 | + </xsl:choose> |
| 46 | + </xsl:template> |
| 47 | + |
| 48 | + <xsl:template match="text()"/> |
| 49 | + |
| 50 | +</xsl:stylesheet> |
Index: trunk/ATTIC/test-server/cc-home/projects/mw/build.xml |
— | — | @@ -0,0 +1,188 @@ |
| 2 | +<?xml version="1.0" encoding="UTF-8"?> |
| 3 | +<project name="MediaWiki" default="build" basedir="."> |
| 4 | + <target name="build" depends="uptodate,init,phpunit,irc-publish" /> |
| 5 | + <property file="build.properties"/> |
| 6 | + |
| 7 | + <!-- |
| 8 | + Prepares the temporary build environment. |
| 9 | + --> |
| 10 | + <target name="prepare" depends="clean,init" /> |
| 11 | + |
| 12 | + <!-- |
| 13 | + Create the required build directories |
| 14 | + --> |
| 15 | + <target name="clean"> |
| 16 | + <delete file="${builddir}/data/my_wiki.sqlite"/> |
| 17 | + <delete file="${sourcedir}/LocalSettings.php"/> |
| 18 | + </target> |
| 19 | + |
| 20 | + <available file="${sourcedir}" property="checkout.exists"/> |
| 21 | + <target name="checkout" unless="checkout.exists"> |
| 22 | + <exec executable="svn"> |
| 23 | + <arg line="checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3 ${sourcedir}" /> |
| 24 | + </exec> |
| 25 | + </target> |
| 26 | + |
| 27 | + <available file="${extensionsdir}" property="extensions.exists"/> |
| 28 | + <target name="checkout-ext" unless="extensions.exists"> |
| 29 | + <exec executable="svn"> |
| 30 | + <arg line="checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions ${extensionsdir}" /> |
| 31 | + </exec> |
| 32 | + </target> |
| 33 | + |
| 34 | + <available file="${builddir}/data/phpuc.zip" property="phpuc.exists"/> |
| 35 | + <target name="fetchphpuc" unless="phpuc.exists"> |
| 36 | + <mkdir dir="${builddir}/data" /> |
| 37 | + <get src="http://github.com/phpundercontrol/phpUnderControl/zipball/0.6.1beta1" |
| 38 | + dest="${builddir}/data/phpuc.zip" |
| 39 | + verbose="on"/> |
| 40 | + </target> |
| 41 | + |
| 42 | + <available file="${builddir}/data/phpdoc" property="phpdoc.exists"/> |
| 43 | + <target name="phpdoctemplates" unless="phpdoc.exists" depends="fetchphpuc"> |
| 44 | + <unzip src="${builddir}/data/phpuc.zip" |
| 45 | + dest="${builddir}/data/"> |
| 46 | + <patternset> |
| 47 | + <include name="**/data/phpdoc/**"/> |
| 48 | + </patternset> |
| 49 | + <mapper type="regexp" from="^p.*/data/phpdoc/(.*)$" to="phpdoc/\1"/> |
| 50 | + </unzip> |
| 51 | + </target> |
| 52 | + |
| 53 | + <target name="init" depends="clean,checkout,checkout-ext"> |
| 54 | + <mkdir dir="${builddir}" /> |
| 55 | + <mkdir dir="${builddir}/api" /> |
| 56 | + <mkdir dir="${builddir}/data" /> |
| 57 | + <mkdir dir="${builddir}/charts" /> |
| 58 | + <mkdir dir="${builddir}/coverage" /> |
| 59 | + <mkdir dir="${builddir}/dist" /> |
| 60 | + <mkdir dir="${builddir}/logs" /> |
| 61 | + <mkdir dir="${builddir}/php-code-browser" /> |
| 62 | + <exec executable="php" dir="${sourcedir}/" failonerror="true"> |
| 63 | + <arg line="maintenance/install.php --dbtype=sqlite --dbpath=${builddir}/data --pass=testpass --showexceptions=true test test"/> |
| 64 | + </exec> |
| 65 | + <exec executable="sh" dir="${sourcedir}/" failonerror="true"> |
| 66 | + <arg line="-c "echo require_once\( dirname\( dirname\( __FILE__ \) \) \) . \'/ExtraSettings.php\'\;>>LocalSettings.php""/> |
| 67 | + </exec> |
| 68 | + <exec executable="php" dir="${sourcedir}/" failonerror="true"> |
| 69 | + <arg line="maintenance/update.php --quick" /> |
| 70 | + </exec> |
| 71 | + </target> |
| 72 | + |
| 73 | + <target name="test-static" depends="prepare"> |
| 74 | + <antcall target="lint" /> |
| 75 | + <antcall target="checkstyle" /> |
| 76 | + <antcall target="phpcb" /> |
| 77 | + <!-- <antcall target="pdepend" /> --> |
| 78 | + </target> |
| 79 | + |
| 80 | + <!-- |
| 81 | + Performs a simple syntax check against the project's source code. |
| 82 | + --> |
| 83 | + <target name="lint"> |
| 84 | + <apply executable="php" logerror="true" failonerror="true"> |
| 85 | + <arg value="-l" /> |
| 86 | + <fileset dir="${basedir}"> |
| 87 | + <include name="**/*.php" /> |
| 88 | + </fileset> |
| 89 | + </apply> |
| 90 | + </target> |
| 91 | + |
| 92 | + <target name="uptodate" depends="checkout,checkout-ext"> |
| 93 | + <exec executable="svn" dir="${sourcedir}"> |
| 94 | + <arg line="up $(svn.up.args} ${sourcedir}" /> |
| 95 | + </exec> |
| 96 | + <exec executable="svn" dir="${extensionsdir}"> |
| 97 | + <arg line="up ${svn.up.args} ${extensionsdir}" /> |
| 98 | + </exec> |
| 99 | + </target> |
| 100 | + |
| 101 | + <target name="apidoc" depends="phpdoctemplates"> |
| 102 | + <exec executable="phpdoc" dir="${sourcedir}"> |
| 103 | + <arg line="--undocumentedelements on |
| 104 | + --target ${builddir}/api |
| 105 | + --templatebase ${builddir}/data/phpdoc |
| 106 | + --output HTML:Phpuc:phpuc |
| 107 | + --directory ${sourcepart} |
| 108 | + --customtags ingroup,defgroup,maintainers,note,addtogroup,showinitializer,protected |
| 109 | + --ignore 'Messages*.php'"/> |
| 110 | + </exec> |
| 111 | + </target> |
| 112 | + <target name="checkstyle"> |
| 113 | + <exec executable="phpcs" dir="${sourcedir}" output="${builddir}/logs/checkstyle.xml"> |
| 114 | + <arg line="--report=checkstyle --standard=PEAR --ignore='Messages*.php,*.css,*.js' ${sourcepart}"/> |
| 115 | + </exec> |
| 116 | + </target> |
| 117 | + |
| 118 | + <target name="phpmd"> |
| 119 | + <exec executable="phpmd" dir="${sourcedir}" output="${builddir}/logs/phpmd.xml"> |
| 120 | + <!-- <arg line="${sourcepart} xml codesize,unusedcode,naming"/> --> |
| 121 | + <arg line="${sourcedir}/includes/ xml codesize"/> |
| 122 | + </exec> |
| 123 | + </target> |
| 124 | + |
| 125 | + <!-- |
| 126 | + Checks several software metrics for the project source |
| 127 | + 20110529: hashar: sourcepart -> sourcedir (we only take care of core) |
| 128 | + --> |
| 129 | + <target name="pdepend" depends="init"> |
| 130 | + <exec executable="pdepend" dir="${sourcedir}" failonerror="false"> |
| 131 | + <arg line="--summary-xml=${builddir}/logs/pdepend.xml |
| 132 | + --jdepend-xml=${builddir}/logs/jdepend.xml |
| 133 | + --jdepend-chart=${builddir}/charts/jdepend.svg |
| 134 | + --overview-pyramid=${builddir}/charts/overview-pyramid.svg |
| 135 | + --coderank-mode=inheritance,property,method |
| 136 | + ${sourcedir}" /> |
| 137 | + </exec> |
| 138 | + </target> |
| 139 | + |
| 140 | + <target name="phpunit" depends="prepare"> |
| 141 | + <exec executable="./phpunit.php" dir="${sourcedir}/tests/phpunit" failonerror="true"> |
| 142 | + <!-- |
| 143 | + 20110519 hashar: uses 'tap', disable group 'Database', remove coverage |
| 144 | + 20110521 hashar: stop using 'tap' |
| 145 | + 20110528 hashar: enable 'Database' group |
| 146 | + --> |
| 147 | +<!-- 20110519: backed out line |
| 148 | + <arg line="==configuration suite.xml ==tap ==exclude-group Broken,Destructive,Database,Stub ==log-junit ${builddir}/logs/junit.xml ==coverage-clover ${builddir}/logs/phpunit.coverage.xml ==coverage-html ${builddir}/coverage" /> |
| 149 | +--> |
| 150 | + <arg line="--configuration suite.xml --exclude-group Broken,Stub --log-junit ${builddir}/logs/junit.xml" /> |
| 151 | + </exec> |
| 152 | + </target> |
| 153 | + |
| 154 | + <target name="phpcb"> |
| 155 | + <exec executable="phpcb" dir="${sourcedir}"> |
| 156 | + <arg line="--log ${builddir}/logs --source ${sourcedir} --output ${builddir}/php-code-browser"/> |
| 157 | + </exec> |
| 158 | + </target> |
| 159 | + |
| 160 | + <!-- Get commiters userinfos from svn --> |
| 161 | + <available file="${builddir}/data/userinfo" property="userinfo.exists"/> |
| 162 | + <target name="userinfo" unless="userinfo.exists"> |
| 163 | + <exec executable="svn"> |
| 164 | + <arg line="checkout http://svn.wikimedia.org/svnroot/mediawiki/USERINFO ${builddir}/data/userinfo"/> |
| 165 | + </exec> |
| 166 | + </target> |
| 167 | + |
| 168 | + <!-- Converts userinfo to XML format --> |
| 169 | + <target name="userinfo-up" depends="userinfo"> |
| 170 | + <exec executable="svn" dir="${builddir}/data/userinfo"> |
| 171 | + <arg line="up"/> |
| 172 | + </exec> |
| 173 | + <exec executable="php" dir="${builddir}/data/userinfo" output="${builddir}/data/userinfo.xml"> |
| 174 | + <arg line="${basedir}/userinfo-to-xml.php ${builddir}/data/userinfo"/> |
| 175 | + </exec> |
| 176 | + </target> |
| 177 | + |
| 178 | + <!-- Generates build results for IRC notifications --> |
| 179 | + <available file="${logdir}/${logfile}" property="logfile.exists"/> |
| 180 | + <target name="irc-publish" unless="${thisbuildsuccessful}" if="logfile.exists" depends="userinfo-up"> |
| 181 | + <!-- $logfile is the file --> |
| 182 | + |
| 183 | + <xslt in="${logdir}/${logfile}" out="${apache.root}/irc-publish.txt" |
| 184 | + style="${basedir}/irc-publisher.xsl"> |
| 185 | + <param name="userinfo" expression="file://${builddir}/data/userinfo.xml"/> |
| 186 | + </xslt> |
| 187 | + </target> |
| 188 | + |
| 189 | +</project> |
Property changes on: trunk/ATTIC/test-server/cc-home/projects/mw/build.xml |
___________________________________________________________________ |
Added: svn:eol-syle |
1 | 190 | + native |
Index: trunk/ATTIC/test-server/cc-home/projects/mw/userinfo-to-xml.php |
— | — | @@ -0,0 +1,50 @@ |
| 2 | +#!/usr/bin/php |
| 3 | +<?php |
| 4 | + |
| 5 | +if(php_sapi_name() !== "cli") { |
| 6 | + echo "You need to run this from the command line.\n"; |
| 7 | + exit; |
| 8 | +} |
| 9 | + |
| 10 | +if( !isset( $argv[1] ) ) { |
| 11 | + echo "Please pass a directory.\n"; |
| 12 | + exit; |
| 13 | +} |
| 14 | + |
| 15 | +$dir=$argv[1]; |
| 16 | + |
| 17 | +if( !is_dir( $dir ) ) { |
| 18 | + echo "Directory ($dir) doesn't exit.\n"; |
| 19 | + exit; |
| 20 | +} |
| 21 | + |
| 22 | +$doc = new SimpleXMLElement("<userinfo/>"); |
| 23 | +$iter = new DirectoryIterator( $dir ); |
| 24 | + |
| 25 | +foreach( $iter as $file ) { |
| 26 | + if( $file->isDir() ) continue; |
| 27 | + $commitId = $file->getFilename(); |
| 28 | + |
| 29 | + $text = file_get_contents( $file->getPathname() ); |
| 30 | + if( $text === false ) { |
| 31 | + continue; |
| 32 | + } |
| 33 | + |
| 34 | + $committer = $doc->addChild( "committer" ); |
| 35 | + $committer->addAttribute( "id", $commitId ); |
| 36 | + |
| 37 | + $rows = preg_split( "#\n#m", $text ); |
| 38 | + foreach( $rows as $line ) { |
| 39 | + $bit = |
| 40 | + preg_split( "#[[:space:]]*:[[:space:]]*#", $line, 2 ); |
| 41 | + |
| 42 | + if( !isset( $bit[1] ) ) continue; |
| 43 | + |
| 44 | + $name = preg_replace( "#[_ ]#", "-", strtolower( trim( $bit[0] ) ) ); |
| 45 | + |
| 46 | + $committer->addChild( $name, trim( $bit[1] ) ); |
| 47 | + } |
| 48 | +} |
| 49 | + |
| 50 | +echo $doc->asXML(); |
| 51 | +echo "\n"; |
Property changes on: trunk/ATTIC/test-server/cc-home/projects/mw/userinfo-to-xml.php |
___________________________________________________________________ |
Added: svn:eol-syle |
1 | 52 | + native |
Index: trunk/ATTIC/test-server/README |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +These are the configuration files and the layout currently in use at |
| 3 | +http://ci.tesla.usability.wikimedia.org/ |
| 4 | + |
| 5 | +The installation of CruiseControl and phpUnderControl follows the |
| 6 | +directions here: |
| 7 | +http://phpundercontrol.org/documentation/installation.html |
| 8 | + |
| 9 | +After that, the projects/connectfour sample directory is erased and |
| 10 | +the contents of the cc-home directory (e.g. config.xml, |
| 11 | +cruisecontrol.sh, etc) should be copied to your cruisecontrol installation. |
| 12 | + |
| 13 | +You'll also want to install the Saxon-B XSLT parser: |
| 14 | + |
| 15 | + aptitude install libsaxonb-java |
| 16 | + |
| 17 | +Add the cruisecontrol user: |
| 18 | + |
| 19 | + useradd ci |
| 20 | + |
| 21 | +and put cruisecontrol-init.d in /etc/init.d/cruisecontrol: |
| 22 | + |
| 23 | + cp cruisecontrol-init.d /etc/init.d/cruisecontrol |
| 24 | + |
| 25 | +Make sure CCDIR in the init.d script points to your cruisecontrol |
| 26 | +installation. |
| 27 | + |
| 28 | +make it executable |
| 29 | + |
| 30 | + chmod +x /etc/init.d/cruisecontrol |
| 31 | + |
| 32 | +and make the symlinks: |
| 33 | + |
| 34 | + update-rc.d cruisecontrol defaults |
| 35 | + |
| 36 | +Finally, start cruisecontrol: |
| 37 | + |
| 38 | + /etc/init.d/cruisecontrol start |
Index: trunk/ATTIC/test-server/cruisecontrol-init.d |
— | — | @@ -0,0 +1,95 @@ |
| 2 | +#!/bin/sh -e |
| 3 | +### BEGIN INIT INFO |
| 4 | +# Provides: cruisecontrol |
| 5 | +# Required-Start: |
| 6 | +# Required-Stop: |
| 7 | +# Default-Start: 2 3 4 5 |
| 8 | +# Default-Stop: 0 1 6 |
| 9 | +# Short-Description: Start Cruise Control |
| 10 | +### END INIT INFO |
| 11 | + |
| 12 | +PATH="/sbin:/bin:/usr/sbin:/usr/bin" |
| 13 | + |
| 14 | +. /lib/lsb/init-functions |
| 15 | + |
| 16 | +CCDIR=/home/ci/cc |
| 17 | +CCPIDFILE=$CCDIR/cc.pid |
| 18 | +STARTCC=$CCDIR/cruisecontrol.sh |
| 19 | +CCUSER=ci |
| 20 | +HOME=/home/ci |
| 21 | +CCNAME=CruiseControl |
| 22 | + |
| 23 | +export CCDIR |
| 24 | + |
| 25 | +checkproc() { |
| 26 | + if pidofproc -p $CCPIDFILE > /dev/null; then |
| 27 | + return 0 |
| 28 | + else |
| 29 | + return 1 |
| 30 | + fi |
| 31 | +} |
| 32 | + |
| 33 | + |
| 34 | +case "$1" in |
| 35 | +start) |
| 36 | + log_action_begin_msg "Starting $CCNAME" |
| 37 | + |
| 38 | + if checkproc; then |
| 39 | + log_failure_msg "$CCNAME already running." |
| 40 | + exit 1 |
| 41 | + fi |
| 42 | + |
| 43 | + if [ ! -f $STARTCC -o ! -x $STARTCC ]; then |
| 44 | + log_failure_msg "Startup script ($STARTCC) can't be used." |
| 45 | + exit 1 |
| 46 | + fi |
| 47 | + |
| 48 | + cd $CCDIR |
| 49 | + if sudo -u $CCUSER env HOME=$HOME $STARTCC >/dev/null 2>/dev/null; then |
| 50 | + log_action_end_msg $? |
| 51 | + else |
| 52 | + log_action_end_msg $? |
| 53 | + fi |
| 54 | + ;; |
| 55 | + |
| 56 | +stop) |
| 57 | + log_action_begin_msg "Shutting down $CCNAME" |
| 58 | + if [ ! -f $CCPIDFILE ]; then |
| 59 | + log_failure_msg "PID file not found, can't safely shut down." |
| 60 | + exit 1 |
| 61 | + fi |
| 62 | + |
| 63 | + if ! checkproc; then |
| 64 | + log_action_end_msg 0 |
| 65 | + rm $CCPIDFILE |
| 66 | + fi |
| 67 | + |
| 68 | + kill `cat $CCPIDFILE` |
| 69 | + if checkproc; then |
| 70 | + i=0 |
| 71 | + while [ checkproc -a $i -lt 10 ]; do |
| 72 | + i=$(($i+1)) |
| 73 | + sleep 1 |
| 74 | + done |
| 75 | + fi |
| 76 | + |
| 77 | + if checkproc; then |
| 78 | + log_action_end_msg 1 |
| 79 | + else |
| 80 | + log_action_end_msg 0 |
| 81 | + rm $CCPIDFILE |
| 82 | + fi |
| 83 | + |
| 84 | + ;; |
| 85 | +restart) |
| 86 | + $0 stop || true |
| 87 | + $0 start |
| 88 | + ;; |
| 89 | +*) |
| 90 | + echo "Usage: /etc/init.d/networking {start|stop|restart}" |
| 91 | + exit 1 |
| 92 | + ;; |
| 93 | +esac |
| 94 | + |
| 95 | +exit 0 |
| 96 | + |