Press "Enter" to skip to content

Richy's Random Ramblings

Running Jenkins CI for PHP on Amazon EC2 [4/7]

Continued from Preparing PuTTY for Amazon EC2

Connecting to Amazon EC2 using PuTTY

  1. Load PuTTY
  2. In the Hostname box, enter the Public DNS entry of your Amazon EC2 instance (ec1-23-456-78-901.xx-yyyy-1.compute.amazonaws.com)
  3. Click, in the left hand side of the PuTTY window, Connection->SSH->Auth
  4. In the “Private Key Field” select the file you saved from “Preparing PuTTY for Amazon EC2
  5. Click “Open”
  6. Login as “ec2-user”

Continued in Installing and Configuring Jenkins CI

Running Jenkins CI for PHP on Amazon EC2 [3/7]

Continued from Signing up to Amazon EC2 and starting your first image

Preparing PuTTY
Note: These instructions are based on the Windows version of PuTTY and PuTTYgen

  1. Download an install PuTTY and PuTTYgen from http://www.chiark.greenend.org.uk/~sgtatham/putty/ (if there is an “install all” install for your platform, use that)
  2. Load PuTTYgen
  3. Click Load (“Load an existing private key file”)
  4. Select “Show all files (*.*)” in the “Load” box instead of the “PuTTY Private Key Files (*.ppk)”
  5. Select your Amazon EC2 Key (such as AmazonInstance.pem)
  6. Click Load
  7. You should receive the “Succesfully imported foreign key” message
  8. Click “Save private key” (select Yes to “Are you sure you want to save this key without a passphrase to protect it?”)
  9. Save the file somewhere save

Continued in Connecting to Amazon EC2 using PuTTY

Running Jenkins CI for PHP on Amazon EC2 [2/7]

Continued from Part 1 – Introduction

Signing up to Amazon EC2 and starting your first image

  1. Sign up to Amazon’s AWS service at http://aws.amazon.com
  2. You will be prompted for payment details, but you won’t be charged if you use Amazon’s free Micro EC2 instance
  3. Wait for your account to be created – you will get an email once done, but it’ll take a few hours (it took me 3 hours)
  4. Log back into http://aws.amazon.com and select “Amazon EC2”
  5. Select the closest region to yourself in the left hand side
  6. Select “Launch instance” and, if prompted, select “Launch classic wizard”
  7. Select, from the Quck Start tab, the “Basic 64 Bit Amazon Linux AMI” image. This should be near the top and indicated with a big gold star to indicate “Free tier eligible if used with a micro instance”. Click continue
  8. Set the number of instances to 1 and the Instance type to “Micro”.
  9. Under “Launch instances”, select an EC2 availability zone or just leave it set to “No preference”. Click continue.
  10. Ignore the “Advanced instance options” and just click continue
  11. Ignore the Tags page and just click continue
  12. Select “Create a new Key Pair” and give it a name (such as AmazonInstance) and then “Create and download your key pair” and save the file some where important. Click continue.
  13. On the “Create a new security group”, create a name group called “JenkinsSSH” with a description of “Web and SSH access” and:
    • Create a new inbound rule with “Custom TCP rule”, port range “8080”, Source “0.0.0.0/0”. Click Add rule
    • Create a new inbound rule with “Custom TCP rule”, port range “22”, Source “0.0.0.0/0”. Click Add rule
    • Click “Launch” and wait a couple of minutes
    • Once it has launched, scroll down the bottom half of the “My Instances” panel until you see the “Public DNS” and make a record of that entry (ec1-23-456-78-901.xx-yyyy-1.compute.amazonaws.com)

Continued in Preparing PuTTY for Amazon EC2

Running Jenkins CI for PHP on Amazon EC2 [1/7]

Introduction
To ensure code quality for your PHP application, you might want to use a continuous integration service such as Jenkins CI (previously known as Hudson) to run things like PHPUnit, Code Coverage checks, PHP Mess Detector etc. But how do you install and run this cheaply? This series of 7 “easy to follow” tutorials will let you start and stop an Amazon EC2 “Micro” instance (which is free for your first year using Amazon) for testing.

These posts will be published on a daily basis between the 27th of October and 2nd of November inclusive.

  1. Signing up to Amazon EC2 and starting your first image
  2. Preparing PuTTY for Amazon EC2
  3. Connecting to Amazon EC2 using PuTTY
  4. Installing and Configuring Jenkins CI (this is the big/important post)
  5. Make a backup of the Amazon EC2 configuration
  6. Relaunching the Amazon EC2 image