1.

What is Jenkins used for in DevOps?

Answer»

Jenkins is a self-contained, open source automation server(tool) for continuous development.

Jenkins aids and AUTOMATES CI/CD process.

It gets the checked in CODE from VCS like Git using a ‘git plugin’, build the source code, run test cases in a production-like environment and make the code release ready using ‘deploy’ plugin.

  • These continuous DELIVERY pipelines are written in a ‘Jenkinsfile’ which is also checked into project’s source code and version controlled by Git.
  • Pipelines are a continuous set of jobs that are run for continuous delivery and these jobs are integrated at every section of the workflow.
  • Jenkins pipelines easily connect to Docker images and containers to run inside.
  • Pipelines easily provide the desired test environment without having to configure the various system tools and dependencies.

Sample Jenkins file

pipeline {    agent { docker { image 'ubuntu:latest' } }    stages {        stage('build') {            steps {                sh 'uname -a'            }        }    } }
  • Jenkins will start the container- ubuntu with the latest image and execute the test case steps inside it.
  • agent directive SAYS where and how to execute the pipeline
  • jenkinsfile (declarative pipeline)
  • pipeline
  • Jenkins saves US the trouble of debugging after a huge commit history if there was a code break.


Discussion

No Comment Found