Skip to content

Instantly share code, notes, and snippets.

@michalg
Forked from Stubbs/install_jenkins.sh
Last active February 25, 2016 13:03
Show Gist options
  • Select an option

  • Save michalg/4986642 to your computer and use it in GitHub Desktop.

Select an option

Save michalg/4986642 to your computer and use it in GitHub Desktop.
Build environment for Jenkins under CentOS. This script has been tested with Jenkins + CakePHP 2.2
#!/bin/bash
## Install Git #########################################
apt-get install git
## Install Jenkins #####################################
if ! grep jenkins /etc/apt/sources.list; then
echo Please add http://pkg.jenkins-ci.org/debian binary/ to /etc/apt/sources and then run the script again.
exit 1
fi
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
apt-get update
apt-get install jenkins
## Install PHP #########################################
apt-get install php5
## Install Pear ########################################
wget -q -O - http://pear.php.net/go-pear.phar > /tmp/go-pear.phar
php /tmp/go-pear.phar
rm /tmp/go-pear.phar
pear upgrade pear
## Install Phing #######################################
pear channel-discover pear.phing.info
pear install --alldeps phing/phing
## Install PHPUnit #####################################
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
## PHPCPD ##############################################
pear install phpunit/phpcpd
pear channel-discover pear.pdepend.org
pear install pdepend/PHP_Depend
## XDebug ##############################################
apt-get install php5-xdebug
## PHPMD ###############################################
pear channel-discover pear.phpmd.org
pear channel-discover pear.pdepend.org
pear install --alldeps phpmd/PHP_PMD
## PHP_Codesniffer #####################################
pear install PHP_CodeSniffer
## PHPLOC ##############################################
sudo pear install phpunit/phploc
@patrickdaulie
Copy link

Apparently pear.phpunit.de is down and doesn't provide the pear install anymore...

The easiest way to install would to install the phar, but that doesn't work in my jenkins setup where I would like to use phploc in plots...

If you'd have a suggestion please let me know.

Thanx for your script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment