Setup Jenkins with RVM on Centos 5.6

December 11th, 2011

Make sure server is updated

yum update

Install prerequisites

yum install gcc automake autoconf libtool make patch java httpd ruby ruby-devel readline-devel zlib-devel

Add jenkins repo and install

wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
yum install jenkins

Start jenkins and make sure it starts on boot

chkconfig jenkins on
service jenkins start

Jenkins runs on port 8080, so setup Apache to proxy port 80 to Jenkins. Create /etc/httpd/conf.d/jenkins.conf with the following content:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName ci.infused.org
    ServerAlias ci
    ProxyRequests Off
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://localhost:8080/
</VirtualHost>

Now start Apache and make sure it starts on boot

chkconfig on
service https restart

Modify jenkins user to allow login so we can install RVM

moduser -m /var/lib/jenkins -s /bin/bash jenkins

Login as jenkins and install RVM

su - jenkins
mkdir -p ~/.rvm/src
cd ~/.rvm/src
git clone git://github.com/wayneeseguin/rvm.git
cd rvm
./install

Don’t forget to add the required line to ~/.bash_profile

if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi

Install require RVM packages

rvm pkg install readline
rvm pkg install zlib

Install main rubies

rvm install 1.9.3

DBF 1.0.9 update

January 15th, 2009

DBF is a small fast Ruby library for reading dBase, xBase, Clipper and FoxPro database files

Changes in version 1.0.9:

  • Fix incorrect integer column values (only affecting some dbf files)
  • Add CSV export

The Blame Game

January 5th, 2009

In just about every Rails project I’ve worked on over the last several years we’ve needed track the user who creates and updates database records. The most popular solution seems to be DeLynn Berry’s userstamp plugin and, until recently, that’s what we’ve always chosen to use too. But after fighting incompatibility with newer versions of Rails I decided to write my own plugin. Enter Blame.

Blame automatically userstamps create and update operations if the table has columns named created_by and/or updated_by.

Installation:

ruby script/plugin install git://github.com/infused/blame.git

Blame assumes that you are using restful-authentication and expects User.current_user to return the current user. You can override this behavior by overriding the default userstamp_object method in ActiveRecord::Base or in any of your models. For example, maybe you just want to find the current user bases on the a session variable:

:::ruby
# In environment.rb
class ActiveRecord::Base
  def userstamp_object
    User.find(session[:user_id])
  end
end

Maybe you don’t like the default column names of created_by/updated_by. You can customize the column names globally or for individual models:

:::ruby
# Globally in environment.rb
ActiveRecord::Base.created_userstamp_column = :creator_id

# In a model definition
class Subscription
  self.created_userstamp_column = :creator_id
  self.updated_userstamp_column = :updater_id
end

Automatic userstamping can be turned off by setting record_userstamps:

:::ruby
# Globally in environment.rb
ActiveRecord::Base.record_userstamps = false

# In a model definition
class Subscription
  self.record_userstamps = false
end

Blame also adds a migration helper which will add the created_by and updated_by columns (or your custom column names) to your table:

:::ruby
create_table :widgets do |t|
  t.string :name
  t.timestamps
  t.userstamps
end

DBF 1.0.6 update

November 27th, 2007

DBF is a small fast library for reading dBase, xBase, Clipper and FoxPro database files. It is written completely in Ruby and has no external dependencies.

Changes in version 1.0.5:

  • Strip non-ascii characters from column names

DBF 1.0.2 Update

August 15th, 2007

DBF is a small fast library for reading dBase, xBase, Clipper and FoxPro database files. It is written completely in Ruby and has no external dependencies.

Changes in version 1.0.2:

  • Fixes a bug when reading Visual Foxpro memo files.