How to Manage Jenkins in Linux

Jenkins System configuration and Plugin installation

Jenkins is an open source Java-based program with the packages for windows/Linux operating systems. It runs in servlet Container (Tomcat, Glass fish) and is supports more than 400 plugins. Jenkins System configuration and Plugin installation is explained.

Open the browser and type http://< IP_address> :8080 or http://< localhost> :8080 Then enter the login credentials.

Click Manage Jenkins option to configure Jenkins.

The various options of Jenkins are listed as follows.


Click Configure Settings, Type the required fields and click Save to proceed further.

After configuring, click Save.

For managing plugins

Go to Manage Jenkins &rarr Manage Plugins.

For installing plugins and upgrading automatically, click Install without restart.

To install plugin manually,

Open the terminal and run the following command.

[root@linuxhelp1 ~]# cd /var/lib/jenkins/
[root@linuxhelp1 jenkins]# ls
config.xml jenkins.model.DownloadSettings.xml
hudson.model.UpdateCenter.xml jenkins.model.JenkinsLocationConfiguration.xml
hudson.plugins.build_timeout.operations.BuildStepOperation.xml
.
.
.
plugins
hudson.tasks.Mailer.xml secret.key
hudson.tasks.Shell.xml secret.key.not-so-secret
[root@linuxhelp1 jenkins]# cd plugins/

Open the browser and paste the link of the plugin. Here, we are choosing hadoop.

Copy the link location of the required version.

Now paste the link location in the terminal to download the hadoop packages.

[root@linuxhelp1 plugins]# wget http://updates.jenkins-ci.org/download/plugins/hadoop/1.4/hadoop.hpi
--2016-07-06 05:11:08-- http://ftp.tsukuba.wide.ad.jp/software/jenkins/plugins/hadoop/1.4/hadoop.hpi
Resolving ftp.tsukuba.wide.ad.jp (ftp.tsukuba.wide.ad.jp)... 203.178.132.80, 2001:200:0:7c06::9393
Connecting to ftp.tsukuba.wide.ad.jp (ftp.tsukuba.wide.ad.jp)|203.178.132.80|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8061215 (7.7M)
Saving to: ‘ hadoop.hpi’ 

100%[===========================================================================================> ] 80,61,215 403KB/s in 25s

2016-07-06 05:11:33 (314 KB/s) - ‘ hadoop.hpi’  saved [8061215/8061215]

After the downloading, restart the jenkins service.

[root@linuxhelp1 plugins]# systemctl restart jenkins.service

After reloading, open the browser and login with the user credentials. Now the hadoop package is successfully installed.

Go to Manage Jenkins&rarr Manage Plugins and then click Advanced tab to set the firewall configuration.

In Manage Jenkins, click System information to view the system properties.

In Manage Jenkins, click System Logs to view the Jenkins Log.

In Manage Jenkins, click Manage nodes to configure and build node. You can configure any number of nodes as per your requirement.

In Manage Jenkins, click Prepare for shutdown to prevents any new builds from being started.

FAQ
Q
What are the components Jenkins is mainly integrated with?
A
Version Control system like GIT,SVN.
Build tools like Apache Maven.
Q
How to build can be scheduled in Jenkins?
A
By source code management commits,
After completion of other builds,
Can be scheduled to run at specified time (crons),
Manual Build Requests
Q
How will you secure Jenkins?
A
The way I secure Jenkins is mentioned below, if you have any other way to do it than mention that:

Ensure global security is on.
Ensure that Jenkins is integrated with my company’s user directory with appropriate plugin.
Ensure that matrix/Project matrix is enabled to fine tune access.
Automate the process of setting rights/privileges in Jenkins with custom version controlled script.
Limit physical access to Jenkins data/folders.
Periodically run security audits on same.
Q
What is the relation between Hudson and Jenkins?
A
You can just say Hudson was the earlier name and version of current Jenkins. After some issue, the project name was changed from Hudson to Jenkins.
Q
What you do when you see a broken build for your project in Jenkins?
A
There can be multiple answers to this question I will approach this task in the following way:

I will open the console output for the broken build and try to see if any file changes were missed. If I am unable to find the issue that way, then I will clean and update my local workspace to replicate the problem on my local and try to solve it.

If you do it in a different way then just mention that in your answer.