Written for Ubuntu LTS 10.4
$ sudo aptitude update $ sudo aptitude upgrade
$ sudo aptitude install build-essential zlib1g-dev libssl-dev libreadline5-dev openssh-server git-core
Add Hudson package repo to sources.
Add the key:
$ wget -O - http://hudson-ci.org/debian/hudson-ci.org.key | sudo apt-key add -
Add the repository to apt:
$ sudo add-apt-repository 'deb http://hudson-ci.org/debian binary/'
Update apt and install Hudson:
$ sudo aptitude update $ sudo aptitude install hudson
sudo aptitude install nginx
Make Hudson available at a URL:
$ sudo vim /usr/local/nginx/conf/nginx.conf
Then add this to the end of the file (but before the last '}'):
# Hudson
upstream hudson {
server 127.0.0.1:8080;
}
server {
server_name ci.your-url.com; # replace this with the URL you want
# Hudson to be available at
root /var/lib/hudson;
location / {
proxy_pass http://hudson/;
auth_basic "Hudson CI";
auth_basic_user_file /var/opt/hudson/htpasswd;
}
}
Create a username and password (first you need apache2-utils):
$ sudo apt-get install apache2-utils $ sudo mkdir -p /var/opt/hudson $ cd /var/opt/hudson $ sudo htpasswd -b -c htpasswd *username* *password*
Now visit http://ci.your-url.com and check you can log in with the username and password you set. You should see your Hudson instance running.
Generate an ssh key-pair for the hudson user (create it in the default location and don't set a password):
$ sudo su hudson $ ssh-keygen -t rsa -C "you@your-domain.com"
Configure Git:
$ git config --global user.email "you@example.com" $ git config --global user.name "Your Name"
Copy your ssh public key:
$ su *your normal user* $ sudo apt-get install xclip $ sudo cat /var/lib/hudson/.ssh/id_rsa.pub | xclip -sel clip
And add it to your GitHub account.
Next, ssh to GitHub to authenticate:
$ sudo su hudson $ ssh git@github.com
- Visit
http://ci.your-url.com - Follow to
Manage Hudson > Manage Pluginsand install any plugins you need (like Git). - Add a new project to test the system (something like FauxPass).
- Add SCM details and build script.
- Click
Build Now.
(if you are currently the hudson user, switch back to your regular user now)
Open the nginx conf:
$ sudo vim /etc/nginx/conf/nginx.conf
Add a second location with auth_basic turned off:
location ~ /job/(.*)/build {
auth_basic off;
proxy_pass http://hudson;
}
Then visit https://github.com/Username/project-name/edit?hooks=1 and add
http://ci.your-url.com/job/*projectname*/build as a post-recive url.
$ sudo aptitude install mysql-server mysql-client libmysql-ruby libmysqlclient-dev $ sudo gem install mysql
- http://help.github.com/linux-key-setup/
- http://rbjl.net/19-rubybuntu-1-installing-ruby-and-rails-on-ubuntu
- http://articles.slicehost.com/2009/1/6/ubuntu-intrepid-ruby-on-rails
- http://www.hackido.com/2009/04/install-ruby-rails-on-ubuntu-904-jaunty.html
- http://www.elfsternberg.com/2009/11/11/continual-integration-testing-for-web-applications-setting-up-hudson-behind-nginx/
- http://library.linode.com/development/frameworks/ruby/ruby-on-rails/nginx-ubuntu-8.04-hardy
- https://help.ubuntu.com/community/RubyOnRails