Skip to main content

Command Palette

Search for a command to run...

Day 29 Task: Jenkins Important Questions.

Day-29 #90daysofdevopschallenge

Published
β€’4 min readβ€’View as Markdown
Day 29 Task: Jenkins Important Questions.
N

Nikhil Patil

πŸ‘¨β€πŸ’» I love Linux & DevOps! πŸ’»

🐧 LinuxπŸ‘¨β€πŸ’» | DevOps & Cloud Enthusiast | 🌍 Azure Admin | πŸ› οΈ Ansible | πŸ“‚ Git | 🐳 Docker | πŸ”‘ OpenLDAP | πŸ–₯️ System Admin | | πŸš€ Jenkins πŸ› οΈ

🏠 Pune

🌟 I'm really into using and managing computers with Linux. I also like making things work smoothly and quickly.

πŸ“– I work with Microsoft Azure, use tools like Ansible and Git to automate tasks, and make software run in containers with Docker.

πŸ”’ I handle access and security using OpenLDAP, and I'm all about keeping systems running smoothly.

🌐 Exploring opportunities in cloud and DevOps.

πŸ“§ Get in touch: nikrpatil1997@gmail.com

πŸ“Œ Jenkins Interview

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 is the practice of frequently integrating code changes into a shared repository, typically multiple times a day. It aims to detect integration issues and conflicts early in the development process

Continuous Delivery ensures that code changes are always in a deployable state, and deployment can be initiated manually.

Continuous Deployment takes automation a step further by automatically deploying code changes to production after passing automated tests.

Benefits of CI/CD

  • Smaller Backlog

  • Faster Release Rate

  • Fault Isolations

  • More immediate Mean Time To Resolution

  • Increase Team Transparency and Accountability

  • More Test Reliability

  • Easy Maintenance

  • Reduce Costs

  • Smaller Code Changes

What is meant by CI-CD?

CI and CD stand for continuous integration and continuous delivery/continuous deployment.

Continuous Integration is automating the integration of code changes from multiple contributors in a single project.

Continuous Delivery is an extension of CI since it enables automation to deploy manually all the code changes to an environment after merging the changes.

Continuous Deployment is an approach to developing software in a short cycle by automating.

What is Jenkins Pipeline?

Jenkins Pipeline is a tool for automating the process of building and deploying software. It lets you define this process as code, making it easier to manage and control.

How do you configure the job in Jenkins?

  • Create a new Job, and give it a name.

  • Add job description and set triggers.

  • Choose Source Code Management (SCM).

  • Define build actions (commands, scripts) in Build Steps in the execute shell.

  • Save and Apply.

  • Trigger a manual build to test.

  • Check the results in the Console Output.

Where do you find errors in Jenkins?

Check the build history click on the job and in that open console output check the errors Also check Jenkins logs to find the errors

In Jenkins how can you find log files?

Go to /var/log/jenkins/jenkins.log

Jenkins workflow and write a script for this workflow?

A Jenkins workflow, also known as a Jenkins pipeline, is a series of steps or tasks that define the process of building, testing, and deploying software. These steps are typically defined in a script known as a Jenkinsfile.

pipeline {
    agent any
    stages{
        stage("Git Clone") {
            steps{
                git url: "https://github.com/Nikhil418/node-todo-cicd.git", branch: "main"
            }
        }
        stage("Build Image") {
            steps{
              sh "docker-compose build"
        }
    }
        stage("Run Container") {
            steps{
                 sh "docker-compose down"
                 sh "docker-compose up -d"
        }
    }
    }
}

How to create a continuous deployment in Jenkins?

  • Install and configure Jenkins

  • Install required plugin

  • Create a Jenkins pipeline

  • Configure Github integration to connect to the code repository

  • Define build and test stages

  • Implement deployment steps

  • Test the pipeline

  • Implement security and access control

How build a job in Jenkins?

After creation of the job click on the build now option to build the jobs

Why we use pa ipeline in Jenkins?

It enables organizations to define, automate, and manage complex software development workflows with ease. By representing these workflows as code in Jenkinsfiles, teams can maintain a structured approach to building, testing, and deploying their applications. Pipelines promote reusability, ensuring that common tasks and configurations are shared across projects, leading to consistency and reduced redundancy

Is Only Jenkins enough for automation?

No, Jenkins is one of the automation tools required to build and deploy an application. One may need more tools along with Jenkins to build and deploy.

How will you handle secrets?

We add secrets in the credentials section and store and also update the credentials

Explain diff stages in CI-CD setup

The CI/CD pipeline combines continuous integration, delivery, and deployment into four major phases: source, build, test, and deploy. Each phase uses highly detailed processes, standards, tools, and automation.

Name some of the plugins in Jenkins.

  • LDAP

  • Git

  • Web blue ocean

  • Timestamper

  • ssh server