Saturday, December 3, 2016

Setting Up Jenkins At Home


What: I'm going to walk you through setting up Jenkins on your home server.
Why: A recent phone call got me thinking. I knew how to use Jenkins pretty well, but I've never actually been through the process of setting it up on a server. Also, Jenkins is an impressive and widely used automation tool that can do all sorts of things for you, so why not set it up at home?
Environment: I'll be setting up Jenkins on a HP Microserver Gen8 running Ubuntu 14.04 LTS. With that, though some of the steps may apply to other linux distributions, it is tailored for Ubuntu 14.04.
Getting Started:
1. Install OpenJDK8 if you do not already have it installed. Ubuntu did not have the source in its software repository so an <apt-get install openjdk-8-jdk> didn't work for me. If you encounter the same, go ahead and add the webupd8team repository: (Note: The commands include everything inside the first set of "<>" brackets)
<add-apt-repository ppa:webupd8team/java>
<apt-get update>
<apt-get install oracle-java8-installer>
<apt-get install oracle-java8-set-default>
2. Next, install the Apache 2 web server.
<apt-get install apache2>
3. Finally, after you have taken care of its dependencies, it is time to install Jenkins! Only... it also isn't in the Ubuntu repository list. Worry not! We'll do the same thing we did for the OpenJDK8 repository.
<wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add ->
<sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'>
What did we do? The first command adds the repository key to "apt" package manager so Ubuntu can validate it is indeed getting the software from where it believes it is. The second step adds the Jenkins software source list to the "apt" package manager list of sources. Now "apt" knows where to find Jenkins and has a key to validate the software.
<apt-get update>
<apt-get install jenkins>
Update your package manager cache and install Jenkins. When you are ready to start configuring Jenkins, navigate to http://yourhostname:8080. You're done!
See my next post on configuring your newly deployed Jenkins server.


No comments:

Post a Comment