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
@TomGregoryTech3 жыл бұрын
Thanks! Making typos is one of my superpowers :)
@shanmugakesavan19183 жыл бұрын
Thank you, it was helpful, it give an overall idea how Jenkins and SonarQube can be integrated. I liked your teaching style.
@tallbenito4 жыл бұрын
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!
@TomGregoryTech4 жыл бұрын
Sounds like good timing then :) Glad it helped you
@Rodrigo-tb5ij3 жыл бұрын
Thank you, Tom! Your video really helped me.
@chetanpatel14642 жыл бұрын
Thanks
@HaiTran-vw4xo3 жыл бұрын
so touching for an excellent video
@joeygarcia78263 жыл бұрын
Really nice guy! Great teacher too! I'm subscribing!
@chethannag73893 жыл бұрын
Thanks, It was very helpful, I was able to setup quality gates.
@anaschtourou2883 жыл бұрын
Amazing video ! Thanks Tom !
@MJameeGhouri4 жыл бұрын
Thank you so much, very helpful
@norbertwj3 жыл бұрын
Awesome work! It helped a ton! Congratulations
@maryannthomas54563 жыл бұрын
You will also need to install Gradle and Junit plugins in your jenkins
@shraddhapatare65612 жыл бұрын
Hi Tom ,Can you please explain how we can add sonarqube in build lifecycle
@TomGregoryTech2 жыл бұрын
Hi Shraddha. Can you please describe what you're looking for that isn't covered by the video?
@faisaladil57933 жыл бұрын
excellent 🙏
@SilentWalk182 жыл бұрын
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?
@TomGregoryTech2 жыл бұрын
Hi Bishop. What does the Jenkins job console output show under "Quality gate" stage?
@SilentWalk182 жыл бұрын
@@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.
@milindchavan0073 жыл бұрын
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!
@TomGregoryTech3 жыл бұрын
Nice video idea Milind. I added it to my ideas backlog :)
@manum51173 жыл бұрын
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
@TomGregoryTech3 жыл бұрын
Hi Manu. Can you give some more context please? Or send an email (address on website).
@luizhpriotto3 жыл бұрын
Thanks for share! Do you know if there a way to insert the result report of Sonar inside of Jenkins? thx
@TomGregoryTech3 жыл бұрын
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?
@luizhpriotto3 жыл бұрын
@@TomGregoryTech You are right!
@hprangana3 жыл бұрын
thanks, it is worthy
@mrraj71534 жыл бұрын
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
@TomGregoryTech4 жыл бұрын
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.
@nelsonjunior75543 жыл бұрын
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:
@TomGregoryTech3 жыл бұрын
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.
@nelsonjunior75543 жыл бұрын
@@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
@chsri52 жыл бұрын
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 …
@TomGregoryTech2 жыл бұрын
Hi. I'm not really sure what you're asking for here.
@ksmith1694 жыл бұрын
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?
@TomGregoryTech4 жыл бұрын
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.
@saeedbafandeh16313 жыл бұрын
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…
@TomGregoryTech3 жыл бұрын
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/
@cranforddev41142 жыл бұрын
: 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
@TomGregoryTech2 жыл бұрын
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