Sunday, December 14, 2014

Install Jenkins and Plugins/Tools for PHP5 CI on Ubuntu 14.04

You have to be a super user to perform the following steps.

Install Jenkins:
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list
apt-get update
apt-get install jenkins

Go to http://localhost:8080/ with a browser to make sure Jenkins is up and running.

Install Plugins:
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 clover
 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

Download Tools:
wget https://phar.phpunit.de/phpunit.phar
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
wget https://phar.phpunit.de/phploc.phar
wget http://static.pdepend.org/php/latest/pdepend.phar
wget https://phar.phpunit.de/phpcpd.phar
wget http://phpdox.de/releases/phpdox.phar
curl -s http://getcomposer.org/installer | php
chmod +x *.phar

Install and Verify:
mv phpunit.phar /usr/local/bin/phpunit
 phpunit --version
      PHPUnit 4.4.0 by Sebastian Bergmann.

mv phpcs.phar /usr/local/bin/phpcs
 phpcs --version
PHP_CodeSniffer version 2.0.0 (stable) by Squiz (http://www.squiz.net)

mv phpcbf.phar /usr/local/bin/phpcbf
 phpcbf --version
  PHP_CodeSniffer version 2.0.0 (stable) by Squiz (http://www.squiz.net)

mv phploc.phar /usr/local/bin/phploc
 phploc --version
  phploc 2.0.6 by Sebastian Bergmann.

mv pdepend.phar /usr/local/bin/pdepend
 pdepend --version
  PDepend 2.0.4

mv phpcpd.phar /usr/local/bin/phpcpd
 phpcpd --version
  phpcpd 2.0.1 by Sebastian Bergmann.

mv phpdox.phar /usr/local/bin/phpdox

 phpdox --version
  phpDox 0.7.0 - Copyright (C) 2010 - 2014 by Arne Blankerts

mv composer.phar /usr/local/bin/composer
 composer --version
  Composer version 1.0-dev (4cc52afcc4debecf4fa7ce998198355fea98e656) 2014-12-13 18:54:43

No comments: