Follow

Follow
Introduction to CICD and Jenkins

Introduction to CICD and Jenkins

Tushar Rajpoot's photo
Tushar Rajpoot
ยทNov 21, 2022ยท

3 min read

Play this article

Table of contents

  • What is CICD pipeline?
  • Elements of a CI/CD pipeline
  • Before continuous integration
  • After Continuous Integration
  • What is Jenkins?
  • Workflow of Jenkins
  • Advantages of Jenkins

What is CICD pipeline?

A CI/CD pipeline is a series of steps that must be performed in order to deliver a new version of the software

A CI/CD pipeline introduces monitoring and automation to improve the process of application development, particularly at the integration and testing phases, as well as during delivery and deployment. Although it is possible to manually execute each of the steps of a CI/CD pipeline, the true value of CI/CD pipelines is realized through automation.

Elements of a CI/CD pipeline

The steps that form a CI/CD pipeline are distinct subsets of tasks grouped into what is known as a pipeline stage. Typical pipeline stages include:

  • Build - The stage where the application is compiled.
  • Test - The stage where code is tested. Automation here can save both time and effort. Release - The stage where the application is delivered to the repository.
  • Deploy - In this stage code is deployed to production.
  • Validation and compliance - The steps to validate a build are determined by the needs of your organization. Image security scanning tools, like Clair, can ensure the quality of images by comparing them to known vulnerabilities (CVEs).
    • Continuous Integration
      • Build
      • Test
      • Merge
    • Continuous Delivery
      • Automatically release to repository
    • Continuous Deployment
      • Automatically deploy to production

    Before continuous integration

  • Problem: Manual builds
    Manually compiling source files, packaging them and updating database schemas cost software teams a lot - both in terms of development effort, as well as development time and cost.
  • Problem: Unhappy Clients
    Any software application that is developed with longer periods between integrations is sure to make it exponentially more difficult to find and fix problems.
  • After Continuous Integration

    Developer --- push code --- CI Server[build,test,deploy]
    

    Continuous Integration = Continuous build + continuous test

    CI/CD pipeline



    PlanDeploy
    Chef, Puppet, Ansible, Terraform etc.
    Code
    github, gitlab
    Operate
    Build
    Maven,gradie etc.
    Monitor
    Nagios, grafana
    Test
    selenium,Junit etc.

    We've a tool for integrating all these tools and work steps.

    Alternatives of Jenkins:

  • Bamboo
  • Tarvis CI
  • Circle CI
  • Github Actions
  • Gitlab CI

  • What is Jenkins?

  • Jenkins is an open-source project writen in Java that runs on windows, macOS, and other Unix like operating systems. It is free, community supported and might be your first choice tool for CI.
  • Jenkins automates the entire software development life cycle.
  • Jenkins was originally developed by Sun Microsystem in 2004 under the name hudson.
  • The project was later names jenkins when Oracle bought Microsystem.
  • It can run on any major platform without any compatibility issues.
  • Whenever developers write code, we integrate all that code of all developers at that point of time and we build, test and deliver/deploy to the client. This process is called CI/CD pipeline.
  • Jenkins helps us to achieve that.
  • Because of CI, Now bugs will be reported fast and get reflected fast so the entire software development happens fast.
  • Workflow of Jenkins

  • We can attach git, Maven, selenium and antifactory plugins to jenkins.
  • Once developers put code in github, jenkins pull that code and send to maven for build.
  • Once build is done, jenkins pull that code and sends to selenium for testing.
  • Once testing is done, then jenkins will pull that code and send to artifactory as per requirement and so on.
  • We can also deploy with jenkins.
  • Advantages of Jenkins

  • It has lots of plugins available.
  • You can write your own plugin.
  • You can use community plugin.
  • Jenkins is not just a tool. It is a framework i.e you can do whatever you want all you need is plugins.
  • we can attach slaves(nodes) to jenkins master, it instruct others(slaves) to do the job, if slaves are not available, jenkins itself does the job.
  • Jenkins also behave as a cron server replacement i.e we can schedule tasks.
  • It can create labels.
  • Did you find this article valuable?

    Support Tushar Rajpoot by becoming a sponsor. Any amount is appreciated!

    See recent sponsors |ย Learn more about Hashnode Sponsors
    ย 
    Share this