Jenkins 1.59 / CentOS 7 / GitHub / Rails / RSpec / Rbenv

As this is for personal use the system I configured has 1 64bit CPU, 1GB of RAM, and 30GB SSD HDD (the $10/mo DigitalOcean plan). I first tried it with the $5 plan, that kept giving me memory issues as Jenkins/Hudson runs on a JavaVM so for my needs 1GB of ram was needed. I won’t be running multiple builds with multiple nodes, pretty much whenever I push code to GitHub/BitBucket I want Jenkins to build and deploy code. If I push to master and it passes deploy to production, If I push to development and it passes deploy to staging.

My setup: 1 VM production server, 1 Physical staging server (in my office), 1 JenkinsCI VM server, and numerous repositories on GitHub and BitBucket.

Setting up Jenkins on CentOS 7

# ssh as root into your server

# grab Jenkins repo
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo

# add to rpm
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

# update yum
yum update

# install git
yum install git

# install dev tools
yum groupinstall "Development Tools"

# install jenkins
yum install jenkins

# install java for jenkins
yum install java-1.7.0-openjdk

# open firewall for 8080 if you have firewalld on and are going to use 8080
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

# restart jenkins service
systemctl restart jenkins.service

# check on status
systemctl status jenkins.service

# add jenkins service boot on restart
chkconfig jenkins on

# at this point jenkins should be running point your browser to http://ip_address:8080

# additional steps if you want to have nginx in front of jenkins
# follow install procedures for nginx here: http://wiki.nginx.org/Install
# or here: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7
# i prefer the digitalocean guide
# and here for nginx conf: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+behind+an+NGinX+reverse+proxy

# things you might need
yum install epel-release
yum install nodejs
yum install npm
yum install sqlite-devel

Setup for Rails / Rbenv

# for rbenv sourced from: https://github.com/sstephenson/ruby-build/wiki#suggested-build-environment
yum install -y gcc openssl-devel libyaml-devel readline-devel zlib-devel

# you might need to change jenkins user to be able to use a shell
vi /etc/passwd

# change jenkins entry from /bin/false to /bin/bash

# switch to jenkins user
su - jenkins

# install rbenv
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
exec -l $SHELL

# list all versions of ruby available
rbenv install --list

# install ruby 2.1.5
rbenv install 2.1.5

# 'rbenv rehash' with newer versions of rbenv this is not required 0.4.0 or later

# set 2.1.5 as global ruby
rbenv global 2.1.5

ruby 

CentOS 7 and PostgreSQL 9.3

Process to install and initialize.

# ssh into server

cd
curl -O http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm

# add to yum
rpm -ivh pgdg*
yum list postgres

yum install postgresql93-server

# initialize database
/usr/pgsql-9.3/bin/postgresql93-setup initdb

# start database
systemctl start postgresql-9.3 # or service postgres-9.3 start

# caveat make sure postgres owns and can write to the directory where the db files are stored.
# /var/lib/pgsql/9.3/data
# if not
# chown -Rf postgres:postgres /var/lib/pgsql/9.3/data
# chmod 700 /var/lib/pgsql/9.3/data/
# then run start command

# switch to postgres user
su - postgres

psql

# quit
\q

# create a user that can create databases (-d can create databases -R can't create roles -P prompt for password)
createuser -d -R -P username

# kill user session
exit

Ubisoft – Assassin’s Creed Unity

Thank you Ubisoft! I now am going to think twice when it comes to pre-ordering games. I wanted to like this game so much like the other Assassin’s Creed games but with all the bugs and the user experience is just unplayable. I’ve jumped from one rooftop to another just to end up in an endless free fall. I am every disappointed.