1 / 18

Jenkins Interview Questions | Jenkins Interview Questions And Answers | DevOps Tools | Simplilearn

Welcome to this presentation on Jenkins interview questions and answers. Jenkins is a popular DevOps open-source automation server. It is used to automate the non-human part of software development and supports continuous integration and continuous delivery. Jenkins is a server-based system that runs in servlet containers such as Apache Tomcat. We have compiled the most important Jenkins interview questions that you might face in a Jenkins or DevOps interview. Now, let us start with the Jenkins interview questions and answers.<br><br>This CI/CD Pipelines with Jenkins Certification Training course will help you learn server automation, continuous integration, build pipelines and configuration tools, automated testing and code quality improvement, and distributed system in Jenkins through intensive, hands-on practice assignments. Simplilearnu2019s online CI/CD Pipelines with Jenkins Certification Training course will teach you the fundamentals of Jenkins and how to continually implement and deploy codes in a DevOps environment. You will also learn how to integrate automated tests to verify the build pipelines and set up code quality reporting.<br><br>Key Features:<br>1. 100% Money Back Guarantee<br>2. 20 hours of instructor-led training<br>3. 1 course-end assessment<br>4. 7 lesson-end projects<br>5. 30 assisted and unassisted practices and demos<br>6. Lesson-end knowledge checks<br>7. Industry-recognized course completion certificate<br><br>Benefits:<br>There are 8000 jobs worldwide for professionals having sound knowledge of continuous integration and continuous deployment with Jenkins. The annual average salary of a Jenkins professional is $100k. Adobe, Oracle, and Accenture are some of the top hiring companies.<br><br>Learn more at https://www.simplilearn.com/jenkins-certification-training-course

Simplilearn
Download Presentation

Jenkins Interview Questions | Jenkins Interview Questions And Answers | DevOps Tools | Simplilearn

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Continuous Integration - Jenkins

  2. 1 Explain master - slave architecture of Jenkins. • Jenkins master pulls the code from the remote GitHub repository every time there is a code commit • It distributes the workload to all the Jenkins slaves • On request from Jenkins master, the slaves carry out builds and tests and produce test reports

  3. Click here to watch the video

  4. 2 What is a Jenkinsfile? It is a text file that contains the definition of a Jenkins pipeline and is checked into source control repository There is a single source of truth for the pipeline which can be viewed and edited Allows code review and iteration on the pipeline Permits audit trail for the pipeline What it does?

  5. 3 Which of the following commands runs Jenkins from the command line? (a) java –jar Jenkins.war (b) java –war Jenkins.jar (c) java –jar Jenkins.jar (d) java –war Jenkins.war

  6. 4 What concepts are key aspects of Jenkins pipeline? Pipeline: User-defined model of a CD pipeline. Pipeline’s code defines entire build process, that includes building, testing and delivering an application Node: A machine which is part of Jenkins environment capable of executing a pipeline Pipeline key aspects Stage: Defines a conceptually distinct subset of tasks performed through the entire pipeline (build, test, deploy stages) Step: A single task that tells Jenkins what to do at a particular point in time

  7. 5 Which file is used to define dependency in maven? (a) build.xml (b) pom.xml (c) dependency.xml (d) version.xml

  8. 6 Explain the two types of pipeline in Jenkins along with their syntax. Jenkins provides 2 ways of developing a pipeline code: Scripted and Declarative Scripted Pipeline: It is based on Groovy script as their Domain Specific Language. One or more node blocks does the core work throughout the entire pipeline Execute this pipeline or any of its stages on any available agent Jenkinsfile (Scripted Pipeline) node { stage(‘Build’) { // } stage(‘Test’) { // } stage(‘Deploy’) { // } } 1 1 Defines the Build stage 2 2 3 Performs steps related to Build stage 3 4 Defines the Test stage 4 5 Performs steps related to Test stage 5 6 7 Defines the Deploy stage 6 Performs steps related to Deploy stage 7

  9. 6 Explain the two types of pipeline in Jenkins along with their syntax. Jenkins provides 2 ways of developing a pipeline code: Scripted and Declarative Declarative Pipeline: It provides a simple and friendly syntax to define a pipeline. Here, pipeline block defines the work done throughout the pipeline Jenkinsfile (Declarative Pipeline) pipeline { agent any stages { stage(‘Build’) { steps { // } } stage(‘Test’) { steps { // } } stage(‘Deploy’) { steps { // } } } } 1 Execute this pipeline or any of its stages on any available agent 1 2 Defines the Build stage 2 3 Performs steps related to Build stage 3 Defines the Test stage 4 4 Performs steps related to Test stage 5 5 Defines the Deploy stage 6 6 Performs steps related to Deploy stage 7 7

  10. 7 How do you create a backup and copy files in Jenkins? To create a backup, periodically backup your JENKINS_HOME directory periodically JENKINS_HOME files Build jobs configurations JENKINS_HOME contains Slave node configurations Build history To create a back-up of your Jenkins setup, copy JENKINS_HOME directory. You can also copy a job directory to clone or replicate a job or rename the directory

  11. 8 How can you copy Jenkins from one server to another? Copy the jobs directory from the old server to the new one copy Jobs directory (old server) Jobs directory (new server) Following are the ways to do it: • Move a job from one installation of Jenkins to another by copying the corresponding job directory • Create 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

  12. 9 Name three security mechanisms Jenkins uses to authenticate users. 1 Jenkins can be configured to employ the authentication mechanism used by the application server upon which it is deployed Jenkins uses an internal database to store user data and credentials 2 Lightweight Directory Access Protocol (LDAP) server can be used by Jenkins to authenticate users 3

  13. 10 How to deploy a custom build of a core plugin? Steps to deploy a custom build of a core plugin • Copy the .hpifile to $JENKINS_HOME/plugins • Remove the plugin’s development directory • Create an empty file called <plugin>.hpi.pinned • Restart Jenkins and use your custom build of a core plugin

  14. 11 How can you temporarily turn off Jenkins security if the administrative users have locked themselves out of the admin console? contains a file JENKINS_HOME folder Config.xml • When security is enabled, Config file contains an XML element named useSecurity that will be set to true • By changing this setting to false, security will be disabled the next time Jenkins is restarted

  15. 12 What are the ways in which build can be scheduled/run in Jenkins? • By source code management commits • After completion of other builds • Scheduled to run at specified time • Manual build requests

  16. 13 Mention the commands that you can use to restart Jenkins manually. Two ways to manually restart Jenkins: Forces a restart without waiting for builds to complete (Jenkins_url)/restart Allows all running builds to complete before it restarts (Jenkins_url)/safeRestart

More Related