Setting up Continuous Integration on Linux server

The instructions below are for a RedHat/CentOS server but can be easily adapted for other Linux distributions.

Installing Jenkins

https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+RedHat+distributions

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

sudo service jenkins start

A jenkins user has been created, its home directory is /var/lib/jenkins

Configuring Jenkins

Installing JDK 8

Through Jenkins administration, add a JDK 8 automatic installer.

Installing Maven

Through Jenkins administration, add a Maven automatic installer from Apache’s site.

Installing NodeJS

Install Jenkins NodeJS plugin.

Through Jenkins administration, add a NodeJS instllation:

  • Automatic installer from nodejs.org, latest stable 4.xx.xx version (5.x.x versions tested and working)
  • Global npm packages to install: bower gulp

This way you can easily configure different versions of NodeJS if you need them in the future.

# specify which version we want
export NODE_VERSION=4.3.1

# download
cd /tmp
wget http://nodejs.org/dist/v$NODE_VERSION/node-v4.3.1.tar.gz
tar xvfz node-v$NODE_VERSION.tar.gz

# build it and install it only locally
cd node-v$NODE_VERSION
./configure --prefix=/var/lib/jenkins/node-v$NODE_VERSION && make && make install

# Check versions of node and  npm
export PATH=/var/lib/jenkins/node-v$NODE_VERSION/bin:$PATH
node --version
# v4.3.1
npm --version
# 3.7.5

# install tools
npm install -g bower gulp
bower --version
# 1.7.7
gulp --version
# 3.9.1

Make sure you update the Jenkins PATH.