In this blog post I will show how to launch a Centos 5.2 Amazon ami image, install Cruise 1.1 from Thoughtworks (also known as Cruise Control) and building a Java project, fetched from a github repository.

Start new image with ElasticFox

RightImage CentOS 5.2 Base Image, Version 4.0.2 (32-bit) (ami-1363877a)
Centos 5.2.

conntect to it with ssh

ssh -i $EC2_PAMKEY_FILE rootec2-XX-XX-XX-XX.compute-1.amazonaws.com@

install git (version working with submodules, last with working dependencies from kernel.org)

cd /etc/yum.repos.d/; wget http://kernel.org/pub/software/scm/git/RPMS/git.repo

add

 
[git] name=Base source git repository baseurl=http://www.kernel.org/pub/software/scm/git/RPMS/SRPMS enabled=1 gpgcheck=0

to git.repo
 
yum install yum-utils yumdownloader --source git rpm -i git-1.6.0.2-1.fc9.src.rpm yum install openssl-devel curl-devel expat-devel xmlto asciidoc rpmbuild -bb /usr/src/redhat/SPECS/git.spec

… make a coffee brake …
 
Wrote: /usr/src/redhat/RPMS/i386/git-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/git-all-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/git-svn-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/git-cvs-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/git-arch-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/git-email-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/git-gui-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/gitk-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/perl-Git-1.6.0.2-1.i386.rpm Wrote: /usr/src/redhat/RPMS/i386/git-debuginfo-1.6.0.2-1.i386.rpm

cd /usr/src/redhat/RPMS/i386/

yum remove git

rpm -i perl-Git-1.6.0.2-1.i386.rpm git-1.6.0.2-1.i386.rpm

git —version
git version 1.6.0.2


To be able to use Cruise you must register for a licence key at thougthworks

fetch rpm files

 
wget http://download01.thoughtworks.com/cruise11/cruise-server-1.1-5477.noarch.rpm wget http://download01.thoughtworks.com/cruise11/cruise-agent-1.1-5477.noarch.rpm

install rpm files
 
rpm -i cruise-server-1.1-5477.noarch.rpm using default settings from /etc/default/cruise-server Started Cruise Server on http://domU-XX-XX-XX-XX-XX-XX:8153/cruise[ OK ]

add your key which was sent by mail:

in the pipelines panel add your git repo and check connection.

first you might get:

 
Repository git@github.com:user/my-repo.git not found! : Error performing command: --- Command --- git ls-remote git@github.com:user/repo.git --- Environment --- {} --- INPUT ---- --OUTPUT --- --- ERROR --- ERROR: Host key verification failed. ERROR: fatal: The remote end hung up unexpectedly ---

ssh into your centos amazon instance and do exactly that: accept the host-key:
 
git ls-remote git@github.com:user/my-repo.git The authenticity of host 'github.com (65.74.177.129)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,65.74.177.129' (RSA) to the list of known hosts. Permission denied (publickey). fatal: The remote end hung up unexpectedly

check the connection again. the next error you probably will get is:
 
Repository git@github.com:user/my-repo.git not found! : Error performing command: --- Command --- git ls-remote git@github.com:user/repo.git --- Environment --- {} --- INPUT ---- --OUTPUT --- --- ERROR --- ERROR: Permission denied (publickey). ERROR: fatal: The remote end hung up unexpectedly ---

so we need a public/private keypair.
follow the steps in providing-your-ssh-key
at github. No everything should work ok.

define your pipeline and add the cruise agent

 
rpm -i cruise-agent-1.1-5477.noarch.rpm Now please edit /etc/default/cruise-agent and set CRUISE_SERVER to the IP address of your Cruise Server. Once that is done start the Cruise Agent with '/etc/init.d/cruise-agent start' [root@domU-XX-XX-XX-XX-XX-XX:~/cruise] /etc/init.d/cruise-agent start using default settings from /etc/default/cruise-agent Started Cruise Agent. [ OK ]

Interested in Cloud or Chef Trainings? Have a look at our Commandemy Trainings page. Need help migrating to the cloud? Check out Infralovers.

comments powered by Disqus
Blog Tags