Installing Jenkins on CentOS 6

You may have heard or read articles regarding continuous integration and delivery and thought how exactly does one do that? Well, the simple answer is to constantly build your application when you add new code to the code base. This can become a tiresome task as builds may take time and if a code push breaks the application you may need to roll back the push entirely. This is where a platform such as Jenkins comes in. Jenkins is software that allows for continuous integration, which means that when a developer makes changes to the code base and pushes them, Jenkins will trigger a build of the application and run any test automatically. In this article, we will cover how to install Jenkins on your server. 

 

Prerequisites:

  •  CentOS server  

 

Update CentOS

Let’s start with making sure Ubuntu is up to date.

sudo yum update

 

Install Java and configure environment variables

Jenkins is Java application so now we will install the java environment we need. 

yum install java-1.8.0-openjdk-devel.x86_64

 

Now we need to set up the Java variables. 

cp /etc/profile /etc/profile.bak
echo -e "export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk" >> /etc/profile
echo -e "export JRE_HOME=/usr/lib/jvm/jre" >> /etc/profile
source /etc/profile

 

Take a look at your new environment variables with the following command. 

echo -e "$JAVA_HOMEn$JRE_HOME"

 

Install Jenkins

Add Jenkins repo to your machine.

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

Now you can install Jenkins

yum install jenkins -y

 

Start Jenkins

/etc/init.d/jenkins start

When Jenkins is up and running you can see the GUI interface by going to http://localhost:8080.

The default password is stored in

/var/lib/jenkins/secrets/initialAdminPassword

 

In this article, we have installed Jenkins on your server. In the next article, we will go more in-depth into setting up an application using Jenkins.   

Leave a Reply

Your email address will not be published. Required fields are marked *