Continuous integration/Overhaul
This has been used as a documentation / working page when the WMF switched from phpundercontrol to Jenkins back in 2011. As of Nov. 2012, most of this has been migrated in a puppet class under operations/puppet.git Antoine "hashar" Musso (talk) 15:52, 21 November 2012 (UTC) |
Progress/documentation page for new Continuous Integration server to host CruiseControl & Jenkins on one server.
Dependencies
editRequired base packages
editAll of the following packages are pulled directly from Ubuntu 10.04 LTS, not the Wikimedia repository:
- ant
- git-core
- imagemagick
- libapache2-mod-php5
- mysql-server
- php-apc
- php5-cli
- php5-curl
- php5-gd
- php5-intl
- php5-mysql
- php-pear
- php5-sqlite
- php5-tidy
- subversion
- sqlite3
Secondary packages
editJenkins is not shipped with Ubuntu and anyway, you want an up-to-date version. To do so we will add a new repository to the debian packaging system.
Firstly, you need to add Jenkins PGP keys to be able to authenticate downloaded packages. Do the following:
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
Then you can add the remote repository from which to fetch additional packages. Add the following to /etc/apt/sources.list
deb http://pkg.jenkins-ci.org/debian binary/
Then fetch the list of packages and request installation of the jenkins package:
apt-get update apt-get install jenkins
PEAR packages
editMust first set desired package stability to 'beta', using pear config-set preferred_state beta
. The following channels must be added to a default pear install:
pear channel-discover pear.pdepend.org pear channel-discover pear.phpmd.org pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com
Then do the following:
pear install pdepend/PHP_Depend pear install phpmd/PHP_PMD pear install phpunit/phpcpd pear install phpunit/phploc pear install PHPDocumentor pear install PHP_CodeSniffer pear install --alldeps phpunit/PHP_CodeBrowser pear install --alldeps phpunit/PHPUnit
You now have PHPUnit installed entirely.
Jenkins plugins
edit(After installing Jenkins and starting it)
- Checkstyle (for processing PHP_CodeSniffer logfiles in Checkstyle format)
- Clover PHP (for processing PHPUnit code coverage xml output)
- DRY (for processing phpcpd logfiles in PMD-CPD format)
- HTML Publisher (for publishing the PHPUnit code coverage report, for instance)
- JDepend (for processing PHP_Depend logfiles in JDepend format)
- Plot (for processing phploc CSV output)
- PMD (for processing PHPMD logfiles in PMD format)
- Violations (for processing various logfiles)
- xUnit (for processing PHPUnit logfiles in JUnit format)
wget http://localhost:8080/jnlpJars/jenkins-cli.jar java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin checkstyle java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin cloverphp java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin dry java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin htmlpublisher java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin jdepend java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin plot java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin pmd java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin violations java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin xunit java -jar jenkins-cli.jar -s http://localhost:8080 safe-restart