Ratnam 9966804142
Q1. What is Jenkins?
Jenkins is an open-source automation tool written in Java with plugins built for Continuous Integration
purposes. Jenkins is used to build and test your software projects continuously making it easier for
developers to integrate changes to the project, and making it easier for users to obtain a fresh build. It
also allows you to continuously deliver your software by integrating with a large number of testing and
deployment technologies.
Q2. Define the process of Jenkins.
● First, a developer commits the code to the source code repository. Meanwhile, the Jenkins
server checks the repository at regular intervals for changes.
● Soon after a commit occurs, the Jenkins server detects the changes that have occurred in the
source code repository. Jenkins will pull those changes and will start preparing a new build.
● If the build fails, then the concerned team will be notified.
● If the build is successful, then Jenkins deploys the build in the test server.
● After testing, Jenkins generates feedback and then notifies the developers about the build and
test results.
● It will continue to check the source code repository for changes made in the source code and
the whole process keeps on repeating.
Q3. What are the benefits of using Jenkins?
I will suggest you include the following benefits of Jenkins if you can recall any other benefit apart from
the below-mentioned points you can include that as well.
● At the integration stage, you can cache build failures.
● For each change in the source code, you generate an automatic build report notification.
R-Testing Solutions
Ratnam 9966804142
● To notify developers about build report success or failure, Jenkins integrates with the LDAP mail
server.
● Achieves continuous integration agile development and test driven development.
● With simple steps, you can automate the maven release project.
● Easy tracking of bugs at an early stage in a development environment than production.
Q4. Mention some of the useful plugins in Jenkins
Below I have mentioned some important Plugins:
● Maven 2 project
● Git
● Amazon EC2
● HTML publisher
● Copy artifact
● Join
● Green Balls
Q5. What is Maven? What is the benefit of integrating Maven with Jenkins?
Maven is a build management tool. It uses a simple pom.xml to configure all the dependencies needed
to build, test and run the code. Maven manages the full lifecycle of a test project. Once integrated with
Jenkins, the maven Webdriver will build the project and execute all tests efficiently.
Q13. How will you define Post in Jenkins?
Post is a section that contains several additional steps that might execute after the completion of the
pipeline. The execution of all the steps within the condition block depends upon the completion status
of the pipeline. The condition block includes the following conditions – changed success, always, failure,
unstable and aborted.
Q6. What are Parameters in Jenkins?
Parameters are supported by Agent section and they are used to support various use-cases pipelines.
Parameters are defined at the top-level of the pipeline or inside an individual stage directive.
Q7. What is Groovy?
R-Testing Solutions
Ratnam 9966804142
Groovy from Apache is a language designed for the Java platform. It is the native scripting language for
Jenkins. Groovy-based plugins enhance Jenkins with great interfaces and build reports that are of
dynamic and consistent nature.
Q8. How will you secure Jenkins?
The way I secure Jenkins is mentioned below if you have any other way to do it than mention that:Make
sure that the global security is on.
● Check if Jenkins is integrated with my company’s user directory with an appropriate plugin.
● Ensure that the 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 the same.
Q9. What are the various ways in which build can be scheduled in Jenkins?
You can schedule a build in Jenkins in the following ways:
● By source code management commits
● After completion of other builds
● Can be scheduled to run at a specified time (crons)
● Manual Build Requests
Q10. What is the use of Pipelines in Jenkins?
Pipeline plugin is used in Jenkins for making the Jenkins Pipeline, which gives us the view of stages or
tasks to perform one after the other in the pipeline form. It models a series of related tasks. Pipelines
help the teams to review, edit and iterate upon the tasks. Pipelines are durable and it can optionally
stop and wait for human approval as well to start the next task. A pipeline is extensible and can perform
work in parallel. It supports complex CD requirements.
Q11. Explain the terms Agent, post-section, Jenkinsfile
Agent: It is directive to tell Jenkins to execute the pipeline in a particular manner and order.
R-Testing Solutions
Ratnam 9966804142
Post-section: If we have to add some notification and to perform other tasks at the end of a pipeline,
post-section will definitely run at the end of every pipeline’s execution.
Jenkinsfile: The text file where all the definitions of pipelines are defined is called Jenkinsfile. It is being
checked in the source control repository.
Q12. What is the use of JENKINS HOME directory?
All the settings, logs and configurations are stored in the JENKINS_HOME directory.
Q13. What is a backup plugin? Why is it used?
This is a helpful plugin that backs up all the critical settings and configurations to be used in the future.
This is useful in cases when there is a failure so that we don’t lose the settings.
Q14. What is a trigger? Give an example of how the repository is polled when a new commit is
detected.
Triggers are used to define when and how pipelines should be executed.
When Jenkins is integrated with an SCM tool, for example, Git, the repository can be polled every time
there is a commit.
● The Git plugin should be first installed and set up.
● After this, you can build a trigger that specifies when a new build should be started. For
example, you can create a job that polls the repository and triggers a build when a change is
committed.
Q15. How do you define parameters for a build in Jenkins?
A build can take several input parameters to execute. For example, if you have multiple test suites, but
you want to run only one. You can set a parameter so that you are able to decide which one should be
run. To have parameters in a job, you need to specify the same while defining the parameter. The
parameter can be anything like a string, a file or a custom.
Q16. How does Jenkins authenticate users?
There are 3 ways –
● The default way is to store user data and credentials in an internal database.
R-Testing Solutions
Ratnam 9966804142
● Configure Jenkins to use the authentication mechanism defined by the application server on
which it is deployed.
● Configure Jenkins to authenticate against LDAP server.
Q17. How can you use a third-party tool in Jenkins?
Below are the steps used for working with a third-party tool in Jenkins.
● First install the third-party software
● Download the plug-in that supports the third-party tool.
● Configure the third-party tool in the admin console.
● Then use the required plug-in from the Jenkins build job.
For different third-party tools, the procedure may vary slightly, because of the difference in
configuration settings.
Q18. What are the types of pipelines in Jenkins?
There are 3 types –
1. CI CD pipeline (Continuous Integration Continuous Delivery)
2. Scripted pipeline
3. Declarative pipeline
Q19. Name a Jenkins environment variable you have used in a shell script or batch file.
There are numerous environment variables that are available by default in any Jenkins build job. A few
commonly used ones include:
● $JOB_NAME
● $NODE_NAME
● $WORKSPACE
● $BUILD_URL
● $JOB_URL
Note that, as new Jenkins plug-ins are configured, more environment variables become available. For
example, when the Jenkins Git plug-in is configured, new Jenkins Git environment variables, such as
$GIT_COMMIT and $GIT_URL, become available to be used in scripts.
Q20. What is Continuous Integration In Jenkins?
R-Testing Solutions
Ratnam 9966804142
In software development, multiple developers or teams work on different segments of the same web
application. So in this case, you have to perform integration testing by integrating all modules. In order
to do that an automated process for each piece of code is performed on a daily bases so that all your
codes get tested. This process is known as continuous integration.
Q21. How do you achieve continuous integration using Jenkins?
Here are the steps –
● All the developers commit their source code changes to the shared Git repository.
● Jenkins server checks the shared Git repository at specified intervals and detected changes are
then taken into the build.
● The build results and test results are shared to the respective developers
● The built application is displayed on a test server like Selenium and automated tests are run.
● The clean and tested build is deployed to the production server.
Q.22 What are the types of jobs or projects in Jenkins?
These are the types of jobs/projects in Jenkins –
● Freestyle project
● Maven project
● Pipeline
● Multibranch pipeline
● External Job
● Multi-configuration project
● Github organization
Q23. What is Continuous Testing?
Continuous Testing is the process where you execute automated tests as part of the software delivery
pipeline. This is done so that you get the feedback on the business risks associated with software as
early as possible. It consists of evolving and extending test automation to address the increased
complexity and pace of modern application development and delivery.
Continuous Testing means that testing takes place on a continuous basis without any disruption of any
kind. In a Continuous DevOps process, a software change is continuously moving from Development to
Testing to Deployment. The code undergoes continuous development, delivery, testing and deployment.
R-Testing Solutions
Ratnam 9966804142
Q24. Explain how you can move or copy Jenkins from one server to another?
I will approach this task by copying the jobs directory from the old server to the new one. There are
multiple ways to do that, I have mentioned it below:
You can:
● Move a job from one installation of Jenkins to another by simply copying the corresponding job
directory.
● Make a copy of an existing job by making a clone of a job directory by a different name.
● Rename an existing job by renaming a directory. Note that if you change a job name you will
need to change any other job that tries to call the renamed job.
Q25. How can you temporarily turn off Jenkins security if the administrative users have locked
themselves out of the admin console?
The JENKINS_HOME folder contains a file named config.xml. When you enable the security, this file
contains an XML element named useSecurity that changes to true. If you change this setting to false,
security will be disabled the next time Jenkins is restarted.
<useSecurity>false</useSecurity>
However, we must understand that disabling security should always be both a last resort and a
temporary measure. Once you resolve the authentication issues, make sure that you re-enable Jenkins
security and reboot the CI server.
Q26. Can you define a Continuous Delivery Workflow?
The flowchart below shows the Continuous Delivery Workflow. Hope it will be much easier to
understand with visuals.
R-Testing Solutions
Ratnam 9966804142
Q27. What is the difference between Continuous Delivery and Continuous Deployment?
Continuous Delivery: (Manual Deployment to Production. Does not involve every change to be
deployed.)
Continuous Delivery is a software development practice where you build software in such a way that the
software can be released to the production at any time. You achieve Continuous Delivery by
continuously integrating the products built by the development team, running automated tests on those
built products to detect problems and then push those files into production-like environments to ensure
that the software works in production.
R-Testing Solutions
Ratnam 9966804142
Continuous Deployment: (Automated Deployment to Production. Involves deploying every change
automatically)
Continuous deployment means that every change that you make, goes through the pipeline, and if it
passes all the tests, it automatically gets deployed into production. So, with this approach, the quality of
the software release completely depends on the quality of the test suite as you have automated
everything.
Q 28. How can you define a Continuous Delivery Workflow?
Answer: The flowchart below shows the Continuous Delivery Workflow. Hope it will be much easier to
understand with visuals.
R-Testing Solutions
Ratnam 9966804142
Q 29. What is the difference between Continuous Integration, Continuous Delivery, and Continuous
Deployment?
Answer: The diagrammatic representation given below can elaborate on the differences between
Continuous Integration, Continuous Delivery, and Continuous Deployment more precisely.
Continuous Integration:
(Involves keeping the latest copy of the source code at a commonly shared hub where all the
developers can check to fetch out the latest change in order to avoid conflict)
Continuous Delivery:
R-Testing Solutions
Ratnam 9966804142
(Manual Deployment to Production. Does not involve every change to be deployed.)
Continuous Deployment:
(Automated Deployment to Production. Involves every change to be deployed
automatically.)
R-Testing Solutions