DevOps(Day-38) : Jenkins Interview Questions (Part-1)
Here are some Jenkins-specific questions related to Docker that one can use during a DevOps Engineer interview:
Questions
What’s the difference between continuous integration, continuous delivery, and continuous deployment?
Continuous Integration - It is the process of automating the steps for developers by building and testing the code before merging it into the commit branch.
Developers push the code in small increments to Version Control System which is GitHub, i.e then build through some tools like Maven and then tested.
Continuous Delivery and Deployment - It is the process of releasing the final version of the code to the server environment may be it is in Production.
The basic difference between Continous Delivery and Continous Deployment is, In Continous Delivery, there is a need for manual intervention to push the final code into Production or a higher environment whereas in Continous Deployment the final code is deployed automatically through the pipeline setup.
Benefits of CI/CD
it enhances the overall code quality. It enables developers to integrate their code into a common repository in small batches. Through this repository, developers can share their builds with the entire team rather than working in isolation. Now, the whole team can collaborate for thorough detection and fixation of the most severe bugs.
Using CI/CD, the code changes can be tested quickly once they are integrated. Such an approach is very beneficial when direct communication is a roadblock or when teams are spread across remote locations.
Detecting the root cause of a fault and then pointing out the exact location of the fault is one of the most proclaimed benefits of CI/CD.
Using a CI/CD pipeline limits the potential impact and loss that a deployment problem can cause by allowing it to be deployed during non-critical business hours.
Regular maintenance and updates are the backbone of making a great product, and this is one of the great benefits of CI/CD. It ensures that release cycles are shorter and targeted, which blocks fewer features that aren’t ready for release. In a CI/CD pipeline, maintenance is usually done during non-business hours, saving precious time for the entire team.
What is meant by CI-CD?
CI-CD stands for Continous Integration-Continous Deployment where the code is pushed by the developer to the Version control system and then deployed on the server continuously.
What is Jenkins Pipeline?
A Jenkins pipeline is a collection of events or jobs which are interlinked with one another in a sequence.
It is a combination of plugins that support the integration and implementation of continuous delivery pipelines using Jenkins.
In other words, a Jenkins Pipeline is a collection of jobs or events that brings the software from version control into the hands of the end users by using automation tools. It is used to incorporate continuous delivery in our software development workflow.
A pipeline has an extensible automation server for creating simple or even complex delivery pipelines "as code", via DSL (Domain-specific language).
How do you configure the job in Jenkins?
Go to Jenkins dashboard and click on the new item. Then select freestyle project.
Provide the details in general settings.
Go to Build environment and then Build step. Write the required code that can be shell commands, batch files, etc.
Click on build now to create the project, or set up automatic triggers to run it based on events such as code changes or scheduled builds through webhook.
Now, check the console output of the build and then you can navigate to the web URL to check the application.
Where do you find errors in Jenkins?
I have faced errors while integrating Jenkins with GitHub. There was a credential error because the correct private token generated needs to be configured in the source code management section.
The shell commands should be written which should be having proper permission given on the server. I have faced an error here which I prevented by using sudo <command>, else you can provide a proper group to the user.
Plugins should be installed while executing a pipeline. I have faced an error which I solved by installing Docker-Compose, Git, and Docker plugins according to the project requirement.
In setting up the Master-Slave configuration, I faced issue in the integration of Agent. The solution is to install all the required plugins, permissions and installation in the Slave server.
In Jenkins how can you find log files?
To view the Jenkins logs in Linux, we can use the following command:
$ sudo cat /var/log/jenkins/jenkins.log
We can also view the logs on a Jenkins server from the Jenkins dashboard.
Start by logging into your Jenkins web interface -> Manage Jenkins -> System Log.
Jenkins workflow and write a script for this workflow?
Jenkins workflow which is otherwise known as Jenkins Pipeline is used to create a complete build step through Groovy language. It allows users to create a pipeline containing different stages which contain different steps to be performed.
Let's write a script for a workflow.
Comments
Post a Comment