Jenkins: Installation 2.9
Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository frequently.
Each check-in is then verified by an automated build, allowing teams to detect problems early so that we can detect errors quickly, and locate them more easily.
Jenkins is an open source tool to perform continuous integration: monitor a version control system and to start a build system.
Jenkins monitors the whole build process and provides reports and notifications.
Here is a description from Meet Jenkins : What is Jenkins?Jenkins is an award-winning application that monitors executions of repeated jobs, such as building a software project or jobs run by cron. Among those things, current Jenkins focuses on the following two jobs:
- Building/testing software projects continuously, just like CruiseControl or DamageControl. In a nutshell, Jenkins provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.
- Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Jenkins keeps those outputs and makes it easy for you to notice when something is wrong.
Jenkins: The Definitive Guide Paperback (Open source ed.) - by John Ferguson Smart
We'll install the Jenkins on Ubuntu 14.04 system.
Let's use Debian package repository of Jenkins to automate installation and upgrade. First add the key to our system:
$ wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
Then add the following entry in our /etc/apt/sources.list:
deb http://pkg.jenkins-ci.org/debian-stable binary/
Or one liner:
$ sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
We need to update our local package index, and then finally install Jenkins:
$ sudo apt-get update $ sudo apt-get install jenkins
Now we have /etc/init.d/jenkins start script which starts Jenkins automatically at boot time. In other words, Jenkins will be launched as a daemon up on start.
- Jenkins will be launched as a daemon up on start (/etc/init.d/jenkins).
- The jenkins user is created to run this service.
- Log file will be placed in /var/log/jenkins/jenkins.log. Check this file if troubleshooting Jenkins. /etc/default/jenkins will capture configuration parameters for the launch like e.g JENKINS_HOME.
- By default, Jenkins listen on port 8080. Access this port with browser to start configuration.
If we start it locally, we can see it running under http://localhost:8080/ URL.
Just follow the instructions.
Select "Suggested Plugins":
At this point, most likely we already have java installed since Jenkins is a Java web application. We need at least the Java Runtime Environment, or JRE to run it. So, let's check if we have it:
$ java -version openjdk version "1.8.0_91" OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-0ubuntu4~14.04-b14) OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
Note : we'll be using Jenkins mostly to build a Java application using Maven. Maven is a widely-used build tool in the Java world, with many powerful features such as declarative dependency management, convention over configuration, and a large range of plugins. For our build, we will also be using recent versions of the Java Development Kit (JDK) and Maven.
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization