Online Tutorials & Training Materials | STechies.com
Register Login

Jenkins Interview Questions and Answers 2019

|| 0

Jenkins Interview Questions and Answers 2019
Stechies

What is Jenkins?

Jenkins is an automation tool used for continuous integration and is open source. This tool is used for making it easier for programmers to develop and test software applications, and integrate the changes into a final project.

Why use Jenkins?

Jenkins allows developers to deploy their product by including different testing and deployment strategies. So through automation, the organizations can enhance the software development process and release more software applications. It also helps the developers to stay connected and see the different changes that are taking place by adding  Slack along with Jenkins.

Multiple jobs can be clubbed together using the Jenkins pipeline plug-in, that increases the overall efficiency of the application.

What is the requirement for using Jenkins?

The requirements for using Jenkins are as follows:

  • A repository where the source code is available and accessible, like GitHub
  • A build script within the repository

What are some important characteristics of Jenkins?

Some important characteristics of Jenkins are as follows:

  • It is open source and freely available
  • The installation is easy for different operating systems
  • Simple user interface
  • Its functionalities can be enhanced through a huge variety of plug-ins
  • Supports build pipelines
  • The setup environment can be configured easily
  • It has a master-slave architecture that reduces the load on the command line server through the support of distributed builds

What is the use of Jenkins in the testing project?

The use of Jenkins in a testing project are:

  • Automation testing can be performed remotely through Jenkins on the destination machine
  • Test reports can be generated easily
  • According to the test cases, the thresholds can be developed
  • The automation can be scheduled as per the user’s choice
  • Notifications can be sent for the test reports

What is Jenkins pipeline?

A Jenkins pipeline is a sequence of interconnected jobs or events. It supports the continuous delivery pipeline implementation through a group of plug-ins. A pipeline can create delivery pipelines through an automation server.

A continuous delivery pipeline has a group of interconnected events build, deploy, test and release.

What are the various steps involved in a Jenkins pipeline?

The different steps involved in a Jenkins pipeline are built, deploy, test, and release. All of the steps are interlinked and are important for the development of the software application. Therefore, every modification done in the software goes through these processes, before the final product is released.

How to restart Jenkins?

Two ways to restart Jenkins are as follows:

  • (jenkins_url)/restart – This command restarts Jenkins without waiting for the builds to finish
  • (jenkins_url)/safeRestart - This command restarts Jenkins after waiting for the builds to finish. After the restart is over, the new jobs are executed that are waiting in the queue.

These commands will work after the Jenkins IP address is provided in the browser. For example, http://localhost:8080/restart.  

What is continuous integration in Jenkins?

In Jenkins, right after a code commit is performed, the application is built and tested. This process is called continuous integration. In big software projects, the developers make many commits per day, and the process of developing and testing are done immediately.

If the test is successful, the application is tested for deployment. If the deployment process is a success, the application code is taken forward for production.

What is SCM in Jenkins?

SCM stands for Source Control Management and is primarily used for protecting the original source code files and preserving the changes made to it. In Jenkins, Poll SCM is used for checking whether new changes are made and if new code commits are found, it starts building the project.

Which SCM tools does Jenkins support?

The different SCM tools supported by Jenkins are:

  • Git
  • Subversion
  • AccuRev
  • RTC
  • Perforce
  • Clearcase
  • Mercurial

How to trigger Jenkins after build in RTC commit?

To trigger Jenkins right after a build has been committed, Jenkins had to be notified by configuring the job to poll SCM frequently. Polling allows the developer to monitor changes on an RTC CSM workspace. If changes are observed, a build is triggered.

Trigger builds can also be monitored remotely using the Trigger Builds remotely checkbox and specifying a token in the following command:

JENKINS_URL/job/JOB_NAME/build?token=TOKEN_NAME

Explain the relation between Hudson and Jenkins?

Hudson is a continuous integration tool that was developed by Kohsuke Kawaguchi, while he was working for Sun Inc. It was written in the Java programming language and can be executed by the Apache Tomcat. When Sun Inc was bought by Oracle, there were organizational problems and Hudson was renamed to Jenkins by the original developers.

So, Hudson is under Oracle and Jenkins is its continuation that is now a separate organization run by the creators.

How to schedule Hudson to build periodically in Jenkins?

The steps to schedule build periodically in Hudson are:

  • Click on the job and click on Configure
  • Go to the Build Triggers section and check the Build Periodically checkbox
  • In the Schedule section, add the period for the build to run in the format MINUTE HOUR DOM MONTH DOW. For example, to run a job at 10:30 PM on the 4thof June, then write 22 30 4 6 *.
  • Click Save to save the build

How to schedule a job in Jenkins?

The steps to schedule the Hudson to build periodically are as follows:

  • Go to the Build Triggers section in the job configuration page
  • Tick the Build Periodically checkbox
  • A Schedule label text box appears immediately. Here, the time period value has to be provided in a format that is cron compliant.
  • After clicking outside the textbox, the next time the job will run can be seen. Save the job to see the current status

What are important commands are available to Jenkins?

The most common commands of Jenkins are:

  • help – This is used for obtaining a complete list of available Jenkins commands
  • build – This is used by the user to trigger any pipeline or job for which they are having permissions
  • console – This is used for obtaining the console output for the pipeline execution or the build that has been specified
  • who-am-i – This command is used to view the current user’s permissions and credentials

How to start Jenkins on Linux?

Go to the command line and type the following command to start Jenkins on Linux :

$ sudo service Jenkins start

How to setup SonarQube in Jenkins?

Steps to setup SonarQube in Jenkins are:

  • Using the Jenkins Update centre install the SonarQube plug-in
  • Log into the Jenkins server as an administrator and go to Configure the system in Manage Jenkins
  • In the SonarQube configuration section, click Add SonarQube and provide the values prompted