Continued from Connecting to Amazon EC2 using PuTTY
Installing and Configuring Jenkins CI
- Connect to your Amazon EC2 image as per Connecting to Amazon EC2 using PuTTY
- In the SSH window, run:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
- In the SSH window, run:
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
- In the SSH window, run:
sudo yum install jenkins
- In the SSH window, run:
sudo service jenkins start
- Whilst we are waiting for Jenkins to start up, we can install PHP and associated modules
- In the SSH window, run:
sudo yum install php git
- In the SSH window, run:
wget http://pear.php.net/go-pear.phar;sudo php go-pear.phar
- You will be prompted if you want to make any changes to the PEAR installation. Select to change the “Installation base ($prefix)” 1 to /usr
- You will be prompted if “Would you like to alter /etc/php.ini”, select “Yes”
- In the SSH window, run:
sudo pear config-set auto_discover 1
- In the SSH window, run:
sudo pecl install xdebug channel://pecl.php.net/dbus-0.1.1
- In the SSH window, run:
sudo pear install pear/XML_RPC2 pear.phpqatools.org/phpqatools PHPDocumentor pear.phpunit.de/PHPUnit channel://pear.php.net/Text_Highlighter-0.7.1 channel://pear.phpundercontrol.org/phpUnderControl-0.6.1beta1 channel://pear.php.net/HTTP_Request2-2.0.0RC2 channel://pear.php.net/Net_URL2-0.3.1 pear.pdepend.org/PHP_Depend phpunit/PHP_CodeBrowser channel://pear.docblox-project.org/docblox-0.15.1
- In the SSH window, run:
sudo su
- In the SSH window, run:
echo 'zend_extension="/usr/lib64/php/modules/xdebug.so"' >> /etc/php.ini
- In the SSH window, run:
echo 'extension=dbus.so' >> /etc/php.ini
- In the SSH window, run:
echo 'date.timezone="Etc/UTC"' >> /etc/php.ini
- In your web browser, go to http://ec1-23-456-78-901.xx-yyyy-1.compute.amazonaws.com:8080 (where http://ec1-23-456-78-901.xx-yyyy-1.compute.amazonaws.com is the hostname of your Amazon EC2 image)
- Click “Manage Jenkins” on the left hand side and then select “Configure system” (in Chrome, you may get the “LOADING…” grey screen covering most things for a long time, just try a different browser)
- Select “Enable security”
- Under “Access Control->Security Realm” select “Jenkins’s own user database” and tick the “Allow users to sign up”
- Under “Authorization” select “Matrix based security”
- Along side “Anonymous” select “Overall->Read”
- In “User/group to add” add your preferred username and click “Add”
- Give yourselves full access by checking the entire row
- Scroll down and click “Save”
- From the home page of Jenkins click “Sign-up now”
- Enter the same username as you did before and your preferred password, name and email address. Click “Sign up”
- Once you’ve logged back in, select “Manage Jenkins” and “Manage Plugins”
- Select “Available” and check the following plugins:
- Checkstyle
- Clover PHP
- DRY,
- JDepend
- Plot
- PMD
- Violations
- Analysis Collector Plugin
- xUnit
If you are developing using GitHub, also select “Github Plugin”
- Scroll down and click “Install”
- Wait and then select “Restart Jenkins when no jobs are running”
- Wait whilst Jenkins restarts
- Go back to “Manage Jenkins->Configure System”
- Scroll down to “Ant” and “Add Ant” and call it “Ant” and select “Install automatically”
- Under the “E-mail notification” under the “Default user e-mail suffix” and “@” followed by your domain name and your email address under “System admin e-mail address”
- Click Save
sudo yum install php-devel gcc make ImageMagick ImageMagick-devel php-dom php-pdo dbus-devel libxml2 libxml2-devel ant php-mbstring swig
Continued in Make a backup of the Amazon EC2 configuration