LAB-1 (JENKINS Installation Document)
LAB-1 (JENKINS Installation Document)
Definition: Jenkins is an open source continuous integration tool written in Java. The
project was forked from the open source Hudson project which was originally
developed at Sun Microsystems (after a dispute with Sun’s acquirer, Oracle). Jenkins
provides continuous integration services for software development. It is a server-
based system, typically run from a servlet container such as Apache Tomcat. It
supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce,
Clear case and RTC, and can execute Apache Ant and Apache Maven based projects
as well as arbitrary shell scripts and Windows batch commands. The primary
developer of Jenkins is Kohsuke Kawaguchi, founder of CloudBees. Jenkins is
released under the MIT License and is free software.
Jenkins Architecture:
Jenkins is a powerful application that allows continuous integration and continuous delivery of
projects, regardless of the platform you are working on. It is a free source that can handle any kind
of build or continuous integration. You can integrate Jenkins with a number of testing and
deployment technologies.
Jenkins Step by step installation on Ubuntu:
In this lab, we will install and test Jenkins on the EC2 Ubuntu server. The server is an Ubuntu
16.04 server. (N.B. If you cannot access the lab VM any base Ubuntu 14.04 system will work).
STEP-1:
Creating an EC2 Ubuntu with basic creating instance server.
Step 3: In order to run the latest version of Jenkins we must have Java 8 installed. To begin the
Jenkins setup, install Java:
sudo apt-get install openjdk-8*
java –version (shows which version of java is installed)
Step4: Now we can download the Jenkins WAR file. For this class, we will download the latest
version of Jenkins
wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
Step 8: Repeat same Step 7 and it will take you to Jenkins page and need to put
the password
Step9: Use this command
ls (you will see log and war file in your Ubuntu home directory)
Step 10:
cat jenkins.log
you will see the password like this when you scroll down
OR
if you don’t find the password follow the path in that page:
/home/ubuntu/.jenkins/secrets/initialAdminPassword
If you are using Virtual Box rather than VMWare as your desktop hypervisor you will need to
forward port 8888 to your host system before you will be able to access the Jenkins server port.
If accessing Jenkins from your host machine is proving problematic you can always install Firefox
on your lab system and use a browser within your lab system to reach Jenkins:
user@ubuntu:~$ sudo apt-get install firefox
user@ubuntu:~$ firefox &
o Running firefox with an “&” suffix runs it in the background. You can lock (pin)
the firefox start icon to the Launcher (launch bar) once it is running so that you can
launch it from the Launcher going forward.
Open your browser and paste public ip address with your port number
Click the “add description” link at the top right of the home page to add a description to your
Jenkins system:
Add your description by clicking the “Submit” button below and to the right of the text box to
display the description on the Jenkins Home page. If you have several Jenkins systems running
adding a description can simplify the process of identifying the various build servers and their
purposes.
Run the following grep search in your lab system using the exact text you added to your home
page:
user@ubuntu: ~$ grep -r "Jenkins Lab System"
.jenkins/config.xml: <description>Jenkins Lab System</description>
As you can see Jenkins keeps configuration in the hidden .jenkins folder by default. This is
known as the JENKINS_HOME directory. We’ll learn more about this directory and configuring
Jenkins in later labs.
Congratulation you have successfully installed and run a Jenkins Server!