How to Create Quality Gate in SonarQube and Automate build to pass or fail using Jenkins Pipeline

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • www.coachdevop...
    SonarQube allows you to create quality gate to force the build to fail if some conditions are not met during code analysis.
    What we will learn in this lab?
    1. Learn how to setup a quality gate in SonarQube
    2. How to force the build to fail in Jenkins when quality gate conditions are met?
    Quality gates
    In SonarQube a quality gate is a set of conditions that must be met in order for a project to be marked as passed.
    Let us learn how to create quality gates in SonarQube and integrate with Jenkins during code scan.
    Pre-requisites
    Jenkins is up and running
    SonarQube is up and running
    Jenkins and Sonarqube already integrated
    Login to SonarQube, Click on Quality gate, enter some name
    Once you create the quality gate. Click on Add condition.
    Select new bugs from the drop down and enter 1 as error
    Choose your Web App, by clicking on App. and select My WebApp
    Setup a Default Gate
    Configure webhooks in SonarQube
    Click on Administration -- Configuration -- Webhooks
    Enter Jenkins URL
    Now to go Jenkins, create a pipeline job:

ความคิดเห็น • 15

  • @PratikLawate
    @PratikLawate 2 ปีที่แล้ว +2

    Very useful. Thanks 😇

    • @DevOpsCoach
      @DevOpsCoach  2 ปีที่แล้ว

      Glad it was helpful!

  • @master2466
    @master2466 3 ปีที่แล้ว +1

    can you show us how to integrate Selenium and other testing frameworks with Jenkins? Also, show us how an application can be deployed from Dev-> test -> Stage->Prod from end to end?

    • @DevOpsCoach
      @DevOpsCoach  3 ปีที่แล้ว

      Watch my other pipeline videos to learn how to deploy into multiple environments in Jenkins. th-cam.com/video/f0Rbk1iVhnc/w-d-xo.html

  • @kishoregowrish1373
    @kishoregowrish1373 ปีที่แล้ว

    very nice but the audio was not audible

  • @venkateshd1208
    @venkateshd1208 ปีที่แล้ว

    Hi, I tried. Quality gate shows failed. Finally I found webhook at Sonarqube not shows delivered.

  • @sujeetsingh4898
    @sujeetsingh4898 2 ปีที่แล้ว

    super!!!

  • @ritikaladdha1253
    @ritikaladdha1253 5 หลายเดือนก่อน +2

    How to do same for Github Actions?

    • @DevOpsCoach
      @DevOpsCoach  5 หลายเดือนก่อน +1

      I already have a video for this :) in my channel --> th-cam.com/video/JocHmIZ9c_U/w-d-xo.html

    • @ritikaladdha1253
      @ritikaladdha1253 5 หลายเดือนก่อน +1

      @@DevOpsCoach Thanks for reply :)

    • @DevOpsCoach
      @DevOpsCoach  5 หลายเดือนก่อน

      You welcome 🙏

  • @ghosteng
    @ghosteng 2 ปีที่แล้ว

    You created a global hook, will this not fail the build for another project scan?

  • @bijayajena8711
    @bijayajena8711 3 ปีที่แล้ว

    Hey I have install quality gate plugin ,sonar scaner is working fine but this quality gate is not working .even I have set sonar webhook from server

    • @DevOpsCoach
      @DevOpsCoach  3 ปีที่แล้ว

      Review the configuration, also how did you set up quality gate?