Cloud Zone is brought to you in partnership with:

John Dobie is an independent consultant specialising in Java enterprise architecture and development. He is a certified as a Java architect, SCWCD, programmer and ScrumMaster(CSM) with over 15 years of Java experience. Most of the last 15 years has been spent in London in Finance IT working on Java trading and banking systems. Currently he specialises in leading and mentoring teams to improving their Agile engineering practices. John is a DZone MVB and is not an employee of DZone and has posted 11 posts at DZone. You can read more from them at their website. View Full User Profile

A Free EC2 Cloud Server With Ubuntu, Jenkins And Sonar.

10.29.2011
| 20292 views |
  • submit to reddit

Introduction

This example shows you how to create a free Amazon EC2 cloud based continuous integration and testing environment on Ubuntu. 

This is a low power server but it is useful for infrequent use. I personally tend to recommend Cloudbees,  but this is handy when you need a free Sonar instance.

You can see it used here

http://johndobie.blogspot.com/2011/06/seperating-test-code-coverage-with.html  

The steps are very simple

  • Sign up for a 1 year free account from Amazon
  • Create a new server from an existing image with Hudson and Sonar.

Viewing The Final Platform

You can see an example of the finished platform by clicking on the links below.

Creating A Free Amazon Account

Amazon offer a free account for new customers. First sign up for the account at the following link.

http://aws.amazon.com/free/

Creating A Free Server

Launch The Console

The free account only allows you to use a restricted set of images and a micro server.

Follow the steps below to create the server.  The first step is to log into the main Amazon console.  

https://console.aws.amazon.com/s3/home


Go to the EC2 Tab and Click 'Launch Instance'

 

Select an Image

Next we have to choose the correct image which contains Ubunto sonar and Jacoco. 
Go to the community tab and look for the following image.

ami-5d5f9234

Notice the 'Star' which shows it is free tier eligible if chosen with a Micro Instance.

Select a Micro Instance.

You can choose the size of the type of server in the next screen.  We want a Micro Instance which is free. 

Notice the type 'Micro (t1.micro, 613MB). Leave the defaults and click on 'Continue'

Again leave the defaults and click on continue.

Advanced Instance Options

Leave the defaults and click on continue.

Instance Properties

Leave the defaults and click on continue.

Create Key Pair

This key pair is important because it is needed to connect to your server. 

Click on the 'Create & Download your key pair'.  Keep the file safe.

Creating A Security Group

The next screen allows you to define the firewall rules for your server.  

We are going to allow all of the following rules below.  You can make it more restrictive if you like once everything is running.

Instance Details.

The details of your new server will then be summarised. 

Click on 'Launch' to start the server.

Tools to connect to your Server

You will probably be curious to see what is happening on your new server and want to connect to it.

To do this download and install putty. This will give you all the tools you need to connect to the server.

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Converting Your Security Key

Before you can use putty to login you need to convert the .pem key from step 1 to a .ppk key.

Go to your installation of putty and run puttygen. Select load and choose your downloaded .pem file.  

You should see the dialog below.

Next click on 'Save Private key' and save the file somewhere safe.

Connecting To your Server

First run putty and fill in the in the server name

Next click on the SSH -> Auth property.  Browse to the new .ppk file and select it.

Then click open. This should give you a terminal window asking who you want to connect as.

type 'ubuntu'

You should then see yourself logged in.

 

Published at DZone with permission of John Dobie, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)