Index

General

  1. What is continuous integration?
  2. What is the programming language used to build Jenkins?
  3. What is the requirement for using Jenkins?
  4. Explain how you can move or copy Jenkins from one server to another?
  5. Mention what are the commands you can use to start Jenkins manually?
  6. Mention some of the useful plugins in Jenkin.
  7. What is a Cron Job?
  8. Explain how you can deploy a custom build of a core plugin?
  9. Explain how can create a backup and copy files in Jenkins?
  10. Explain how you can clone a Git repository via Jenkins?
  11. Can you start Jenkins using command line? How?
  12. What is a job in Jenkins?
  13. Explain how you can set up Jenkins job?
  14. Mention what are the two components Jenkins is mainly integrated with?
  15. What is the difference between Hudson and Jenkins?
  16. What is Groovy in Jenkins?
  17. What is Jenkinsfile?
  18. What is Jenkins Pipeline? What is a CI CD pipeline?
  19. What is Quite period in Jenkins?
  20. How do you delete old builds?
  21. Why do we use Nodes in jenkins?
  22. How do you send the notifications whether build fails or success?
  23. What is SCM? Which SCM tools are supported in Jenkins?
  24. Which CI Tools are used in Jenkin?
  25. Which Environmental Directives are used in Jenkins?
  26. What are Triggers?
  27. What is Agent Directive in Jenkins?
  28. How will you define Post in Jenkins?
  29. What are Parameters in Jenkins?
  30. What is Flow Control in Jenkins?
  31. What are the basic requirements for installing Jenkins?
  32. What is the use of Backup Plugin in Jenkins?
  33. What is Maven? What is the benefit of integrating Maven with Jenkins?

Advanced

  1. How can you clone a git repository via jenkins?
  2. What are the various ways in which build can be scheduled in Jenkins?
  3. What is Kubernetes? How can you integrate Jenkins with Kubernetes?
  4. Let us say, you have a pipeline. The first job was successful, but the second failed. What should you do next?
  5. What is the use of JENKINS HOME directory?
  6. How does Jenkins authenticate users?
  7. How can you use a third-party tool in Jenkins?
  8. What are the types of pipelines in Jenkins?
  9. What is DevOps and in which stage does Jenkins fit in?
  10. What is a DSL Jenkins?
  11. How do you create Multibranch Pipeline in Jenkins?
  12. What are the types of jobs or projects in Jenkins?
  13. What is blue ocean in Jenkins?
  14. What is Continuous Testing?
  15. How can you temporarily turn off Jenkins security if the administrative users have locked themselves out of the admin console?
  16. What do you mean by Pipeline as a Code?
  17. What are the ways to configure Jenkins node agent to communicate with Jenkins master?
  18. What is the tool used for provisioning and configuration?
  19. How can you decide the no. executors?
  20. Where did your plugins come from Jenkins?
  21. Is it possible to exchange jobs between two different jenkins?
  22. Which plugin is required to deploy a .war file into application server?
  23. How to re-execute a parameterized build without entering the parameter value when the job fails?
  24. How master system will communicate to slave system?
  25. How do you make a job to run only on slave node?
  26. How do you make all the jobs to be run only on slave node?
  27. What is SCM Checkout retry count?
  28. What are stages?
  29. What is Parallel in Jenkins?
  30. What is matrix-based security?
  31. What is a Snippet Generator?


The Questions
General
1. What is continuous integration?

In software development, when multiple developers or teams are working on different segments of same web application, we need to perform integration test by integrating all modules. In order to do that an automated process for each piece of code is performed on daily bases so that all your code get tested.

2. What is the programming language used to build Jenkins?

Java

3. What is the requirement for using Jenkins?

To use Jenkins you require

  • A source code repository which is accessible, for instance, a Git repository.
  • A working build script, e.g., a Maven script, checked into the repository.
4. Explain how you can move or copy Jenkins from one server to another?
  • Slide a job from one installation of Jenkins to another by copying the related job directory.
  • Make a copy of an already existing job by making clone of a job directory by a different name.
  • Renaming an existing job by renaming a directory.
5. Mention what are the commands you can use to start Jenkins manually?

To start Jenkins manually, you can use either of the following

  • (Jenkins_url)/restart: Forces a restart without waiting for builds to complete.
  • (Jenkin_url)/safeRestart: Allows all running builds to complete.
6. Mention some of the useful plugins in Jenkin.
  • Maven 2 project
  • Amazon EC2
  • HTML publisher
  • Copy artifact
  • Join
  • Green Balls
7. What is a Cron Job?

Cron Expression is a utility to schedule job periodically as per the user requirement in Jenkins.

8. Explain how you can deploy a custom build of a core plugin?
  • Stop Jenkins.
  • Copy the custom HPI to $Jenkins_Home/plugins.
  • Delete the previously expanded plugin directory.
  • Make an empty file called .hpi.pinned.
  • Start Jenkins.
9. Explain how can create a backup and copy files in Jenkins?

Jenkins saves all the setting, build artifacts and logs in its home directory, to create a back-up of your Jenkins setup, just copy this directory. You can also copy a job directory to clone or replicate a job or rename the directory.

10. Explain how you can clone a Git repository via Jenkins?

To clone a Git repository via Jenkins, you have to enter the e-mail and user name for your Jenkins system. For that, you have to switch into your job directory and execute the “git config” command.

11. Can you start Jenkins using command line? How?

Yes, using jenkins.exe start.

12. What is a job in Jenkins?

A job or build job is a task or step in the entire build process. It could be compiling the source code, running unit tests, deploying the application to the web server and so on.

13. Explain how you can set up Jenkins job?

To create a project that is handled via jobs in Jenkins. Select New item from the menu, once this done enter a name for the job and select free-style job. Then click OK to create new job in Jenkins. The next page enables you to configure your job.

14. Mention what are the two components Jenkins is mainly integrated with?

Jenkin is mainly integrated with two components

  • Version Control system like GIT, SVN.
  • And build tools like Apache Maven.
15. What is the difference between Hudson and Jenkins?

There is no difference between Hudson and Jenkins. Hudson was the former name of Jenkins, after going through several issues the name was changed to Jenkins.

16. What is Groovy in Jenkins?

Groovy is the default scripting language that is being used in the development of JMeter Version 3.1.

Currently Apache Groovy is the dynamic object-oriented programming language that is used as a scripting language for the Java platform. Apache Groovy comes with some useful features such as Java Compatibility and Development Support.

17. What is Jenkinsfile?

The text file where all the definitions of pipelines are defined is called Jenkinsfile. It is being checked in the source control repository.

18. What is Jenkins Pipeline? What is a CI CD pipeline?

The pipeline can be defined as the suite of plugins supporting the implementation and integration of continuous delivery pipelines in Jenkins.

Continuous integration or continuous delivery pipeline consists of build, deploy, test, release pipeline. The pipeline feature saves a lot of time and error in maintaining the builds. Basically, a pipeline is a group of build jobs that are chained and integrated in sequence.

19. What is Quite period in Jenkins?

Time gap between the builds. In seconds.

20. How do you delete old builds?

Delete old builds in following way: Go to –> General tab –> enable ‘Discard old Builds’ checkbox. Here we will set ‘Days to keep builds’ and ‘Max # of builds to keep’

21. Why do we use Nodes in jenkins?
  1. Single jenkins server will not handle the whole workload of large and heavier build projects.
  2. Sometimes we may required several different environments to test the builds. This will not be done by a single server.
22. How do you send the notifications whether build fails or success?
  1. Configure Email Notification in Configure system under Mange Jenkins.
  2. Email notifications will be configured in job configuration under post-build section.
23. What is SCM? Which SCM tools are supported in Jenkins?
  • SCM stands for Source Control Management.
  • SCM module specifies the source code location.
  • The entry point to SCM is being specified as jenkins_jobs.scm.
  • The job specified with ‘scm’ attribute accepts multiple numbers of SCM definitions.
24. Which CI Tools are used in Jenkin?
  • Jenkins
  • GitLab CI
  • Travis CI
  • CircleCI
  • Codeship
  • Go CD
  • TeamCity
  • Bamboo
25. Which Environmental Directives are used in Jenkins?

Environmental Directives is the sequence that specifies pairs of the key-values called Environmental Variables for the steps in the pipeline.

26. What are Triggers?

Trigger in Jenkins defines the way in which the pipeline should be executed frequently. PollSCM, Cron, etc are the currently available Triggers.

27. What is Agent Directive in Jenkins?

The Agent is the section that specifies the execution point for the entire pipeline or any specific stage in the pipeline. This section is being specified at the top-level inside the pipeline block.

28. 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.

29. What are Parameters in Jenkins?

Parameters are supported by the Agent section and are used to support various use-cases pipelines. Parameters are defined at the top-level of the pipeline or inside an individual stage directive.

30. What is Flow Control in Jenkins?

In Jenkins, flow control follows the pipeline structure (scripted pipeline) that are being executed from the top to bottom of the Jenkins file.

31. What are the basic requirements for installing Jenkins?
  • Java 7 or above.
  • Servlet 3.1
  • RAM ranging from 200 MB to 70+ GB depending on the project build needs.
  • 2 MB or more of memory.
32. What is the use of Backup Plugin in Jenkins?

Jenkins Backup Plugin is used to back up the critical configurations and settings in order to use them in the future in case of any failure or as per the need of time.

33. 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.

Advanced
1. How can you clone a git repository via jenkins?

If you want to clone a Git repository via Jenkins, you have to enter the e-mail and user name for your Jenkins system. Switch into your job directory and execute the “git config” command for that.

2. What are the various ways in which build can be scheduled in Jenkins?
  • By source code management commits.
  • After completion of other builds.
  • Can be scheduled to run at a specified time (crons).
  • Manual Build Requests.
3. What is Kubernetes? How can you integrate Jenkins with Kubernetes?

Kubernetes is a container orchestration tool. With Kubernetes, one can create multiple container instances to achieve more fault tolerance. You can use the Kubernetes deploy plugin to use it with Jenkins for continuous deploy.

4. Let us say, you have a pipeline. The first job was successful, but the second failed. What should you do next?

You just need to restart the pipeline from the point where it failed by doing ‘restart from stage’.

5. What is the use of JENKINS HOME directory?

All the settings, logs and configurations are stored in the JENKINS_HOME directory.

6. How does Jenkins authenticate users?

There are 3 ways:

  • The default way is to store user data and credentials in an internal database.
  • Configure Jenkins to use the authentication mechanism defined by the application server on which it is deployed.
  • Configure Jenkins to authenticate against LDAP server.
7. 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.
8. What are the types of pipelines in Jenkins?

There are 3 types:

  • CI CD pipeline (Continuous Integration Continuous Delivery)
  • Scripted pipeline
  • Declarative pipeline
9. What is DevOps and in which stage does Jenkins fit in?

DevOps is a software development practice that blends software development (Dev) with the IT operations (Ops) making the whole development lifecycle simpler and shorter by constantly delivering builds, fixes, updates, and features. Jenkins plays a crucial role because it helps in this integration by automating the build, test and deployment process.

10. What is a DSL Jenkins?

The Jenkins “Job DSL / Plugin” is made up of two parts – first, The Domain Specific Language (DSL) itself that allows users to describe jobs using a Groovy-based language, and second, a Jenkins plugin which manages the scripts and the updating of the Jenkins jobs which are created and maintained as a result.

11. How do you create Multibranch Pipeline in Jenkins?

The Multibranch Pipeline project type enables you to implement different Jenkinsfiles for different branches of the same project. In a Multibranch Pipeline project, Jenkins automatically discovers, manages and executes Pipelines for branches that contain a Jenkinsfile in source control.

12. 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
13. What is blue ocean in Jenkins?

It is a project that was started with the purpose to rethink the user experience of Jenkins, modeling and presenting the process of software delivery by surfacing information that’s important to development teams. This is done with as few clicks as possible, while still staying true to the extensibility that is core to Jenkins. While this project is in the alpha stage of development, the intent is that Jenkins users can install Blue Ocean side-by-side with the Jenkins Classic UI via a plugin.

14. 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.

15. 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.

false

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.

16. What do you mean by Pipeline as a Code?

Pipeline as Code describes a set of features that allow Jenkins users to define pipelined job processes with code, stored and versioned in a source repository. These features allow Jenkins to discover, manage, and run jobs for multiple source repositories and branches — eliminating the need for manual job creation and management.

17. What are the ways to configure Jenkins node agent to communicate with Jenkins master?

Below mentioned ways help you to start the node agent –

  • Command-line – For this, the client needs the executable agent.jar file. It helps to launch the process on the client to communicate with the Jenkins master to run build jobs.
  • Browser – This file launches a new process on the client machine to run jobs.
18. What is the tool used for provisioning and configuration?

Ansible is an agent-less configuration management and orchestration tool. In Ansible, the configuration modules will be called as Playbooks. Like other tools, Ansible will be used to cloud provision.

19. How can you decide the no. executors?

No. Executors is number of parallel jobs, based on requirement If we required, jenkins should run at max 5 parallel jobs we will provided the number at No. executors.

Manage Jenkins → Configure system → Number of parallel jobs: 5

20. Where did your plugins come from Jenkins?

Plugins can be downloaded from plugins.jenkins.io site

21. Is it possible to exchange jobs between two different jenkins?

Yes, it is possible by using ‘Job Import’ plugin. We will exchange the job between two jenkins. We required providing the source instance (Jenkins) URL. We will import a particular job and all the jobs and also views.

22. Which plugin is required to deploy a .war file into application server?

‘Deploy to Container Plugin’ is required to deploy a.war file into application server.

23. How to re-execute a parameterized build without entering the parameter value when the job fails?

‘Rebuild plug-in’ will allow the user to rebuild a parametrized build without entering the parameters again.

24. How master system will communicate to slave system?

Using ‘slave.jar’ file in slave system master system will communicate to slave system. This file must be present in slave to communicate with.

25. How do you make a job to run only on slave node?

Go to job configuration tab –> under ‘General’ section enable ‘Restrict where this project will be run’ then we will provide the lable name of the node.

26. How do you make all the jobs to be run only on slave node?

Go to –>’Manage jenkins’ –> ‘configure system’ –> at ‘Labels’ mention the node system label.

27. What is SCM Checkout retry count?

It can check the code in SCM tool twice in between the builds, if the value is 2.

28. What are stages?

Stage – Containing a sequence of one or more stage directives, the stages section is where the bulk of the “work” will be described by a Pipeline can be located. At a minimum it will be recommended which stages will contain at least one stage directive for each discrete part of the continuous delivery process, like Build, Test, and Deploy.

29. What is Parallel in Jenkins?

Stages in Declarative Pipeline will declare a number of nested stages within them, which will be executed in parallel. A stage should have only one of either steps or parallel. The nested stages cannot have further parallel stages themselves, otherwise behave the same as any other stage. Any stage which contains parallel cannot have agent or tools, since those are not relevant without steps.

30. What is matrix-based security?

Matrix-based security is one of the approval techniques accessible for verifying Jenkins. It enables you to give explicit consent to clients and gatherings. The accessible authorizations are recorded beneath with their portrayals and are additionally accessible by floating over the consent heading in the Jenkins UI.

31. What is a Snippet Generator?

Snippet Generator is a utility for creating bits of code for individual steps provided by the plugin and it is dynamically populated with a list of the steps available to the Jenkins instance.

Want to test this skill? Check out Adaface assessments

Ansible & Jenkins Online Test

View Test