Add SonarQube quality gates to your Jenkins build pipeline

  Рет қаралды 39,437

Tom Gregory Tech

Tom Gregory Tech

Күн бұрын

Пікірлер: 46
@filz4461
@filz4461 Жыл бұрын
You are amazing Tom! That Webook was wild :)
@dkcarey1
@dkcarey1 3 жыл бұрын
haha so funny, I did see you write webhook wrong and thought "ops, this will cause a road bump". Great video, caused an instant subscribe from me
@TomGregoryTech
@TomGregoryTech 3 жыл бұрын
Thanks! Making typos is one of my superpowers :)
@shanmugakesavan1918
@shanmugakesavan1918 3 жыл бұрын
Thank you, it was helpful, it give an overall idea how Jenkins and SonarQube can be integrated. I liked your teaching style.
@tallbenito
@tallbenito 4 жыл бұрын
Wow, this video was very timely-- I just set up SonarQube recently to scan some projects at work, and my next task is to set up Quality Gates in order to fail the pipeline. Thanks Tom!
@TomGregoryTech
@TomGregoryTech 4 жыл бұрын
Sounds like good timing then :) Glad it helped you
@Rodrigo-tb5ij
@Rodrigo-tb5ij 3 жыл бұрын
Thank you, Tom! Your video really helped me.
@chetanpatel1464
@chetanpatel1464 2 жыл бұрын
Thanks
@HaiTran-vw4xo
@HaiTran-vw4xo 3 жыл бұрын
so touching for an excellent video
@joeygarcia7826
@joeygarcia7826 3 жыл бұрын
Really nice guy! Great teacher too! I'm subscribing!
@chethannag7389
@chethannag7389 3 жыл бұрын
Thanks, It was very helpful, I was able to setup quality gates.
@anaschtourou288
@anaschtourou288 3 жыл бұрын
Amazing video ! Thanks Tom !
@MJameeGhouri
@MJameeGhouri 4 жыл бұрын
Thank you so much, very helpful
@norbertwj
@norbertwj 3 жыл бұрын
Awesome work! It helped a ton! Congratulations
@maryannthomas5456
@maryannthomas5456 3 жыл бұрын
You will also need to install Gradle and Junit plugins in your jenkins
@shraddhapatare6561
@shraddhapatare6561 2 жыл бұрын
Hi Tom ,Can you please explain how we can add sonarqube in build lifecycle
@TomGregoryTech
@TomGregoryTech 2 жыл бұрын
Hi Shraddha. Can you please describe what you're looking for that isn't covered by the video?
@faisaladil5793
@faisaladil5793 3 жыл бұрын
excellent 🙏
@SilentWalk18
@SilentWalk18 2 жыл бұрын
Hello. I am unable to get the sonarqube gate way to fail in Jenkins. I see it failing in sonarqube but not in the Jenkins. Any idea what it could be?
@TomGregoryTech
@TomGregoryTech 2 жыл бұрын
Hi Bishop. What does the Jenkins job console output show under "Quality gate" stage?
@SilentWalk18
@SilentWalk18 2 жыл бұрын
@@TomGregoryTech Hey, I got it to work by adding the webhook directly to the Project in Sonarqube. For some reason it was unable to use the "global one". As for your question, it was outputting "Quality gate is 'OK'", despite it not being 'OK' in Sonarqube. If anyone else has the issue, I did this in Sonarqube: Projects > Select the project > Project Settings Dropdown > Webhooks > (for me it was blank) Create > Name: Jenkins, URL: JENKINS_IP:8080/sonarqube-webhook I should add, that I am running Jenkins and Sonarqube in each their own Docker containers.
@milindchavan007
@milindchavan007 3 жыл бұрын
This is very cool simple to understand nicely explained. Could you please please post video on how we can run selenium test cases and get the results as pass or fail to move ahead in pipeline like you did it with sonar scan Cheers!
@TomGregoryTech
@TomGregoryTech 3 жыл бұрын
Nice video idea Milind. I added it to my ideas backlog :)
@manum5117
@manum5117 3 жыл бұрын
Hi Tom Could you please explain how can we resolve pending background tasks error? In my case I got execution success rather than build success
@TomGregoryTech
@TomGregoryTech 3 жыл бұрын
Hi Manu. Can you give some more context please? Or send an email (address on website).
@luizhpriotto
@luizhpriotto 3 жыл бұрын
Thanks for share! Do you know if there a way to insert the result report of Sonar inside of Jenkins? thx
@TomGregoryTech
@TomGregoryTech 3 жыл бұрын
Hi Luiz. What kind of information are you hoping to make available in Jenkins? Most of the SonarQube report is held in SonarQube. Only minimal details are sent back to Jenkins in the webhook request (see details here docs.sonarqube.org/latest/project-administration/webhooks/). I think you'd have to write something custom to make any of this available to you in Jenkins. But the SonarQube Scanner Jenkins plugin does add a link to the SonarQube project page from the Jenkins job page. Might that be good enough for you?
@luizhpriotto
@luizhpriotto 3 жыл бұрын
@@TomGregoryTech You are right!
@hprangana
@hprangana 3 жыл бұрын
thanks, it is worthy
@mrraj7153
@mrraj7153 4 жыл бұрын
That was great explanation. I have sonar scan and quality gate enabled using groovy in declarative pipeline. But I have some freestyle jobs for that sonar scan is enabled by installing plugin and add sonarqube execution in build section. How do I add quality gate in freestyle jobs?? Thanks in advance
@TomGregoryTech
@TomGregoryTech 4 жыл бұрын
Hey M Raj. That is a good question! Once you have the SonarQube Scanner Jenkins plugin installed, in your job configuration you can click Add build step > Execute SonarQube Scanner. Here you can set various configurations. I haven't used the plugin with freestyle projects before, but I don't think it allows you to wait for quality gate results. Please let me know how you get on.
@nelsonjunior7554
@nelsonjunior7554 3 жыл бұрын
what if my project does not have gradlew, or if i want to use the same pipeline for different git repos, and only change the URL as needed ? is that even possible ? D:
@TomGregoryTech
@TomGregoryTech 3 жыл бұрын
Hi. 1) SonarQube support running the scanner directly as well as within other build tools such as Maven. 2) Look into shared libraries as a way to reuse the same Jenkins pipeline between repositories. Hope it helps.
@nelsonjunior7554
@nelsonjunior7554 3 жыл бұрын
@@TomGregoryTech i found a very messy way of doing this, by installing the scanner file directly inside the jenkins docker, and adding the .properties file on the git repo, with the keyID from sonar now it works with whatever github link i set there ( thankfully ) but thanks for the explanation :p
@chsri5
@chsri5 2 жыл бұрын
Hey Tom ! Always thankful for information, could you please tell whether is it possible to make an unstable build in Jenkins to stable/ success ? If possible in which way can I accomplish it …
@TomGregoryTech
@TomGregoryTech 2 жыл бұрын
Hi. I'm not really sure what you're asking for here.
@ksmith169
@ksmith169 4 жыл бұрын
Hi Tom, Great Video. How hard would it be to get this working on Red Hat OpenShift? I tried just running but it fails at the gradlew sonarqube line. It tries to download gradle but fails. Is there a recommended gradle plug-in I could download to Jenkins in advance and use?
@TomGregoryTech
@TomGregoryTech 4 жыл бұрын
Hi Kevin. I haven't used Red Hat OpenShift before, but imagine it's not too hard if you know what you're doing. You can install Gradle on Jenkins up front, but you lose all the advantages of the Gradle Wrapper (Gradle version set by project etc.). If you want to do that you could try out the Gradle Jenkins plugin plugins.jenkins.io/gradle or if you have a custom Jenkins Docker image install Gradle on there.
@saeedbafandeh1631
@saeedbafandeh1631 3 жыл бұрын
Hello dear engineer We established “a remote git server” and " a SonarQube community edition, Ver. 8.4" separately. We also have Jenkins, Docker and Ansible. We want before any pushing to a remote SCM, user committed new code be analyzed by SonarQube. If the scan result and quality gates passed then new code pushed to the repository; Otherwise, give the appropriate message to the user and push action be canceled. We almost realized can use the " pre-receive hook " or " update hook" in the remote git repository with following settings to connect to the relevant project in SonarQube: -Dsonar.projectKey= ProjectKey -Dsonar.projectName= ProjectName -Dsonar.host.url= SonarQubeURL -Dsonar.login= SonarQubeToken -Dsonar.sources= SourcePath -Dsonar.qualitygate.wait= true Is using the above method a correct thing to do? and the written settings are right and sufficient?! Do you suggest a better solution? Thank you very much for any help. Best regards…
@TomGregoryTech
@TomGregoryTech 3 жыл бұрын
Hi Saeed. It depends on your branch setup as to what the best option is. If you're using feature branches you could perform SonarQube analysis on the branch before it gets merged to master, using Jenkins. This recent article might help tomgregory.com/sonarqube-branch-analysis/
@cranforddev4114
@cranforddev4114 2 жыл бұрын
: Error during SonarScanner execution org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property. @ Tom gregory please help me
@TomGregoryTech
@TomGregoryTech 2 жыл бұрын
Hi. Did you try the example project? I just checked it and it's working. I think that would be a good starting point, as I don't know how your project that is producing the error is setup. github.com/tkgregory/sonarqube-jenkins-example
How to Integrate SonarQube With Jenkins
12:42
CloudBeesTV
Рет қаралды 63 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Jenkins Python Pipeline Tutorial
19:26
Vincent Stevenson
Рет қаралды 40 М.
Gradle Course for Beginners | Get Going with Gradle
56:59
Tom Gregory Tech
Рет қаралды 39 М.
SonarQube - Code Quality and Code Security - Code Quality Gates
16:49
Flutter Explained
Рет қаралды 45 М.
Sonarqube Complete Tutorial 2023
29:33
DevOps Shack
Рет қаралды 110 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН