Coder Social home page Coder Social logo

jenkins's Introduction

CI/CD Jenkins Pipeline with Code Coverage support

Create a Jenkins Pipeline project in Jenkins and Configure this repo in SCM configurations. It will automatically read Jenkinsfile from repo and build will be initialized as per the Jenkinsfile code.

In this Repo we have sample java source code which is built up using maven scripts. We also have junit unit test cases suit in repo which is executed in seperate stages. We have also included sonar code analysis to the pipeline so that we can have a automative process in which if code coverage is more than 50 % ( This can be modified) we are proceeding with deployment otherwise we are simply breaking the jenkins build. We have below stages which are working in this complete CI/CD process.

Stage Checkout Code This will checkout the source code so that we can have source code in our jenkins working directory.

Stage Build We are building source code from repo using Maven build.

Stage Unit test Execution using maven jacoco plugin we are executing maven juint test cases here in sample source code.

Stage Integration Test We can configure Integration test cases also here in this stage.

Stage Sonar Analysis In this stage we are scanning our source code and checking the quality of source code.

Stage Code Coverage This will check for the coverage value from sonar portal using rest api and if coverage is more than 50 % then proceed with further stages.

Stage Archive Artifacts In this Stage we are archiving the artifacts so that we can download them from job builds.

Input Message This will hold the job for approval click on Yes to proceed with further stages.

Stage Production Deployment In the last after approval we can have a production deployment in local tomcat apache webapps folder.

So using this pipeline script we can replicate a complete CI/CD process.

Further Steps:

  1. We can configure a working source code to this pipeline.
  2. We can implement Multi Branch pipeline concept also using the Jenkinsfile
  3. We can include Ansible or any configuration management tool for deployment stage for production.
  4. We can use this pipeline for Non Java builds also.
  5. We can also add more quality checks tools like fortify scan.

jenkins's People

Contributors

gopireddy1135 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.