Skip to content

Instantly share code, notes, and snippets.

@Stubbs
Created February 3, 2012 10:35
Show Gist options
  • Save Stubbs/1729591 to your computer and use it in GitHub Desktop.
Save Stubbs/1729591 to your computer and use it in GitHub Desktop.
Script to install everything you need for PHP CI on a Debian box.
#!/bin/bash
## Install Git #########################################
apt-get install git
## Install Ant #########################################
apt-get install ant
## 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 ##############################################
pear install phpunit/phploc
## DocBlox #############################################
pear channel-discover pear.docblox-project.org
pear install docblox/DocBlox
@benmatselby
Copy link

DocBlox is now superseded with:

## phpDocumentor########################################
pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor-alpha

@guillaumeblaquiere
Copy link

php5-xsl is missing.

@cAstraea
Copy link

I'm getting invalid package name/package file "phpunit/phploc"
for many packages ?

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