How To: Integrity automated continuous integration server with Ruby Enterprise, Passenger and Nginx3 min read ruby integrity passenger
Integrity is a Continuous Integration server solution which is very easy to set up, especially when you work with Git projects. In this short tutorial, I am going to show you hot to get up and running with Integrity in a couple of simple steps. We are going to build a box with Ruby Enterprise, Passenger and Nginx as a web server.
First step is to get all the build essentials required to compile Ruby and Passenger.
sudo apt-get install build-essential
Now let’s create a directory, where we can download software to:
Ruby Enterprise Edition
Ruby Enterprise Edition requires OpenSSL, Readline, Zlib development libraries. We also want to install SQLite 3 development package, because Integrity currently only works with SQLite.
sudo apt-get install libssl-dev libreadline-dev libz-dev libsqlite3-dev
Now, we have to download Ruby Enterprise edition and install it:
tar -zxf ruby-enterprise-1.8.7-20090928.tar.gz
Let’s symlink the executables to some standard path:
for i in *; do sudo ln -s /opt/ruby-enterprise-1.8.7-20090928/bin/$i /usr/local/bin/$i; done
Ruby Enterprise automatically installs Passenger gem. Let’s use it to install Nginx:
sudo passenger-install-nginx-module --auto --auto-download
Installer will ask you to choose installatio directory. Just confirm the default.
Integrity come as a gem. We will also add the IRC notification mechanism. Here I’m using Gemcutter as a repository of choice.
sudo gem install gemcutter
sudo gem install integrity integrity-irc shout-bot
sudo gem install do_sqlite3 -v0.9.11
Make sure that
do_sqlite3 are the same and only version in Rubygems. Otherwise we can have problems where wrong versions are being loaded.
Now, let’s create a place where we want to install our own instance of Integrity:
sudo mkdir /apps
sudo /opt/ruby-enterprise-1.8.7-20090928/bin/integrity install /apps/integrity --passenger
--passenger option. It tells the installer to create Passenger friendly directory layout.
Last things to do is actual configuration. We have to tell Nginx and Passenger that we want to run our new app:
sudo vim /opt/nginx/conf/nginx.conf
server section to look similar to this:
Integrity comes with two configuration files. Let’s tell the app what domain it’s going to use editing this file:
sudo vim /apps/integrity/config.yml
Also, we want to add the IRC notifier:
sudo vim /apps/integrity/config.ru
Add this after current require lines:
Next, we have to migrate the SQLite database like so:
sudo /opt/ruby-enterprise-1.8.7-20090928/bin/integrity migrate_db /apps/integrity/config.yml
Fix the permissions
sudo chown -R `whoami`:nogroup /apps
sudo chmod -R g+w /apps
Start Nginx server
Voila! We have our Integrity server up and running! Go launch the browser and go to the domain you have chosen before. You are probably going to work with Git. Make sure you have
git-core package installed.
Last modified: 06-Feb-24