PDF Jenkins Interview Questions Amp Answers
PDF Jenkins Interview Questions Amp Answers
+919980923226
What is CI? 2
CI is nothing but a software development practise where members of each
team integrate their work daily by integrating their work daily, they can test
it every
day and it reduces the problems and it can identify the problems earlier and
they can fix it earlier...then we can make product more stable That is the
main use of
CI.....If we start the building at the end of the project we will identify so many
issues, those are integration issues because code will be developed by the
multiple developers.....if we start integrating them daily so you identify issues
earlier and we can fix them earlier....
In the jenkins Dashboard left side panel there is option manage jenkins −−−> click on
manage plugin −−−> go to available option −−−−> We can search for the plugin what
we have to integrate with jenkins for ex: git we just type the git plugin in the filter
option and it produces the git related plugins then we have to select it click on
Install with or without restart.....
Basically Git plugin have the dependencies also one is git client plugin and scm API
plugin..
And then once restart the jenkins and now we can configure the job....
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
Next type :
$ lava −jar jenkins.war
$ lenkins.rpm
Now open browser type the default http://localhost:8080 : then it will shows
tomcat homepage
If we want to open jenkins homepage: type http://localhost:8080/jenkins.......Thats
http://localhost:8080/jenkins
it....
How do you change your port no for your jenkins and what is the default port? 13
Ans: go to the tomcat installation folder and from there go to conf folder and open
service.xml there change the port (connector) to 8081 or any other port no from
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
A screen will open like log recorders−−−−−−> All jenkins logs−−−>click on add new
recorder−−−−> we have to choose/enter the name that makes sense to us−−−−−−>click
on ok
−−−> and then we have to configure the logger details ex:hudson.plugin.disk_usage
and select the log level to find and click on add....and click on save....
Once the set up is complete, Jenkins will start collecting data. The collected logs are
From <https://wiki.jenkins−ci.org/display/lENKINS/Logging>
What are the chanllenges who have faced when setting up jenkins 15
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
[geetha@localhost Desktop]$
How do you stop jenkins when some build jobs are in progress 17
To restart lenkins manually, you can use either of the following commands:
There is one op+ion in jenkins; i.e., "preparing for shu+down" if any jobs
are running in jenkins firs+ i+ will comple+e +he process and +hen i+ will
shu+down jenkins....
(Or)
(jenkins_url)/safeRes+ar+ - Allows all running jobs +o comple+e.
New jobs will remain in +he queue +o run af+er +he res+ar+ is
comple+e.
1 In st a l l th e fr e s h je n ki n s i n th e n e w s e rv e r
2 . B e s u r e o ld a n d n e w j e n k in s ar e s to p p e d
3. Archeive all the content of the jenkins_home(.jenkins) of the old
jenkins instance
4. Extract the old jenkins in to the new jenkins_home directory
5. Launch the new jenkins
6. Do not forget to change documentation / links to your instance of your
new jenkins
Where does jenkins store global configuration and job related configuration 21
lenkins stores the configuration for each job within an enonymous directory
in jobs/. The job configuration file is config.xml, the builds are stored in builds/,
and the working directory is workspace/.
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
Or
2. $lENKINS_HOME/jobs contains all the individual job configuration and build data
in a separate subdirectory for each job, e.g. for the job "myjob" you'll have
$lENKINS_HOME/jobs/myjob/config.xml plus other files that store the data for
individual builds.
Or
How do you restore the system configuration and all the jobs?
−−−−−>So if you want to restore the system configuration and all the jobs without
the build history, you'll need to copy:
$lENKINS_HOME/.xml $JENKINS_HOWE/jobs/*/config.xml (using Antglob notation, **
denotes all subdirectories under $lENKINS_HOME/jobs)
From <http://stackoverflow.com/questions/23795752/how−to−restore−jobs−in−jenkins?rq=1>
If you want to change jdk for all your 1000 jenkins jobs or any other configurations? 22
How do you do it?
Go to masters nodes and change theirs lables
i. How do you create jenkins job ii) How did you setup build and deployment using 24
jenkins for your project?
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
Ans: i) in jenkins dashboard−−−> in left side panel −−−−> there will be an option
called "new job" click on it and create the job.....
Ii) go to manage jenkins −−−−> configure system−−−−> there we have to configure
svn path and ant path and save it and now go to project and click on configure
and there we invoke ant for build and for deployment we copy the artifacts in to
tomcat server...
Poll scm : If there is any change in svn it will automatically build...if there is no
changes done in vcs then it will remains constant without doing any kind of build....
2.
Choose "create an account"
3.
Use the user name you've used in the above step, and fill in the rest.
If everything works smoothly, you are now logged on as yourself with full permissions.
If Jenkins is running on a Windows server then it is better to install the Active Directory
plugin.
On a Linux host you have an option to either use the Active Directory plugin or an LDAP
based authentication. To configure the LDAP to work with Active Directory, provide the
following:
Server mydomaincontroller.mycompnay.com:389
Root DN dc=mycompnay,dc=com
Manager DN cn=mymanageruser,ou=users,ou=na,ou=mycompany,dc=mycompany,dc=com
Manager *****
Password
Note that the correct Manager DN value can vary greatly depending on your Active
Directory set up.
job(create/workspace/build/delete/configure/read/cancel/ , run(delete/update),
view(create/delete/ configure /read), scm(tag)
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
lenkins has a built−in command line client that allows you to access lenkins from a
script or from your shell. This is convenient for automation of routine tasks, bulk
updates, trouble diagnosis, and so on.
Obtaining CLI
Jenkins CLI is distributed inside jenkins.war as a jar file. See http://yourserver.com/cli for
where to download the CLI jar file. In theory, the CLI jar is dependent on the version of
Jenkins, but in practice, we expect to be able to retain compatibility between different
versions of Jenkins.
Running CLI
The general syntax is as follows (the design is similar to tools like svn/git):
java -jar jenkins-cli.jar
Have you ever configure junit, cobertura, sonar for your builds? 44
Ans: Based on plugins we will configure this...first we have to install plugin and
then we configure in manage jenkins−−−>system configure .....and we it in our
project
What is pipeline? 46
Calling a different jobs based on request
What kind of issues you have faced with your jenkins so far? 47
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
What is CI and CD 50
If jenkins becomes slow what actions do you take? How do you approach 56
we have to check memory and add more ram if required and we check for any
unused jobs we will take backup and delete that job and we cleanup an un−used
pluggins....wheather memory is over then it will shows out of memory error...
What is Scrum way of working or what is the deveIopment methodoIogy you use 62
and we wiII pIan and divide the requirements......Now Every one have there own
responsibiIty. . .by the end of the day there wiII be a standup meeting there we wiII teII the
status of job done..furture what jobs we have to do......before demo/review session
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
there wiII be a restrospective meeting with our scrum master /project manager personaIIy
reg the status of requirements......And then
at the end of the sprint they have the review / demo session....(its very imp qa wiII tests and
produces demo in front of po if he approves ok fine.....this process wiII be iterated tiII we
reach the goaI of project....
1. When we didnot instaII dependency pIugin then it wiII show the error : BuiId faiIed
:Required goaI not found
TS: instaII the dependency pIugin and configure it and then we trigger a buiId then
buiId wiII be successfuI.
2. Missing artifact: buiId faiIed ....it wiII show the error Iike faiIed to resoIve artifact...one
required artifact is missing...
such type of issue wiII come whiIe we removed artifact from the cache(it happens every few
months)--->
TS: rebuiId that versiion of that moduIe to get it reinstaIIed.
3. ....it's not a fiIe : The error shows Iike : buiId error: faiIed to create assembIy
It happens when the
when a module is build but one of its dependencies is built at the same time
(so its jar is already 'deleted') −> waiting until the dependency build had
finished, then re−triggering the module build fixed it
4. Invalid java version:
It happens when we didnt configure correct version we are usually using
then this error willl occur
TS:
Each hudson job has a jdk to be used − if this is e.g. set to 1.5 but the build
would actually require 1.6 you'll see the above error −> get the job properly
configured
If the issue is related to me....i will resolve it by my side and if not i will send mail
attaching the printscreen to perticular team / person.....
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
•
Tagging builds −−(it is the build ready to release...we will create the tag)
m a t ri x b a s d
s p e c i f ic u s er s
s e c ur i t y. .. .b c z it a ll o w s y o u t o g r a nt o n ly sp e c if ic
a n d g r o u p s. . ..i m e a n s p e c ifi c p e r m is s io ns m e a n s
p e rm is s io n s t o
li ke th e r e w i ll be
a overall permissions like( admin/read/runscripts/upload plugins/configure
update sites and proxy settiings) and some more permissions like slave(configure
to existing slaves/delete /create new slaves/Disconnect slaves/connect slaves) ,
job(create/workspace/build/delete/configure/read/cancel/ , run(delete/update),
view(create/delete/ configure /read), scm(tag)
How do you see the process id and wheather jenkins server is running or not 69
This best practice is around authenticating users and enforcing access control on a Jenkins
instance
In the default configuration, lenkins doeîs not perform any security checks. This means any person
accessing the website can configure lenkins and jobs, and perform builds. While this configuration is
normally acceptable for intranet use and quick setup, it introduces high security risks, like someone
accidentally deleting your build jobs, reconfiguring your job to run every minute, kicking off too
many builds at the same time, reconfiguring your build instance, etc.
'Nuff said.
When you have interdependent projects on lenkins, it often becomes hard to keep track of which
version of this is used by which version of that. lenkins supports "file fingerprinting" to simplify this,
so make best use of it.
The most reliable builds will be clean builds, which are built fully from Source Code Control.
To ensure a build can be reproducible, the build must be a clean build, which is built
fully from Source Code Control. This practice also implies that all code including third-
party jars, build scripts, release notes, etc. must be checked into Source Code
Control.
Integrate tightly with your issue tracking system, like lIRA or bugzilla, to reduce the
need for maintaining a Change Log
The integration helps to track changes as they are made, including build status, what
build hr eas u bl t se ea n dp ea rf toi framc et sd. for this requirement or defects, and the link to
the actual
Integrate tightly with a repository browsing tool like FishEye if you are using
Subversion as source code management tool
Always configure your job to generate trend reports and automated testing when
running a lava build
Trends helps project managers and developers quickly visualize current project
progress status. Moreover, unit testing is often not enough to provide confidence that
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
the delivered software complies to the desired quality. The more you test the
software, the better the delivered software complies to the desired quality.
Set up lenkins on the partition that has the most free disk−space
Jenkins needs some disk space to perform builds and keep archives. All the settings,
build logs, artifact archives are stored under the JENKINS_HOME directory. Simply
All unused jobs should be archived so they can be resurrected if the need arises.
See Administering Jenkins for ways to do this.
Allocate a different port for parallel project builds and avoid scheduling all jobs to
start at the same time
Multiple jobs running at the same time often cause collisions. Try to avoid scheduling
all jobs to start at the same time. Allocate a different port for parallel project builds to
avoid build collisions.
Configure each person on the people list with his or her correct email address and
what role he or she is currently playing.
For example, it may be appropriate to run a limited set of "sniff tests" before the full
suite.
Write jobs for your maintenance tasks, such as cleanup operations to avoid full
disk problems.
Configure lenkins bootstrapper to update your working copy prior to running the
build goal/target
http://mithuntechnologies.com [email protected]
Mithun Reddy Lacchannagari Interview Questions
+919980923226
You can do this by setting the executor count to zero. Instead, make sure all jobs run
on slaves. This ensures that the jenkins master can scale to support many more jobs,
and it also protects builds from modifying potentially sensitive data on
$JENKINS_HOME accidentally/maliciously.
Clone is one type of plugin ....it is used like recycle bin...when our jenkins is slow
we will keep our old builds in clone. .whenever we want again means we will take
from there....
http://mithuntechnologies.com [email protected]