Once you install the SonarQube extension for VSTS/TFS you can setup service endpoint type of SonarQube.
![image image](https://lh3.googleusercontent.com/-BTgVsgZom2o/WKu4PC6suEI/AAAAAAAAIBQ/ruwVSDGTXxU/image_thumb%25255B3%25255D.png?imgmax=800)
This endpoint requires a token as shown below. Server URL is the URL of your Sonar Server.
![image image](https://lh3.googleusercontent.com/-w7cg8E4RPAs/WKu4QB20V-I/AAAAAAAAIBY/_6TwtVmSP6w/image_thumb%25255B7%25255D.png?imgmax=800)
To generate a token go to Sonar server and create a user named like ProjectFeeder (can be any name) with following sonar-users permissions. By default all users get create project and execute analysis permissions that is sufficient to execute analysis with TFS/VSTS builds..
![image image](https://lh3.googleusercontent.com/-tGua9APi2oU/WKu4So541WI/AAAAAAAAIBg/ioIuah82G6M/image_thumb%25255B10%25255D.png?imgmax=800)
Logout from admin user and login with project feeder user to generate a token.On My Account of the Project Feeder user, in the security tab provide a name and generate a token. Then use that token in TFS/VSTS service endpoint.
![SNAGHTML3cdf60b SNAGHTML3cdf60b](https://lh3.googleusercontent.com/-U9VJ1YUBAxc/WKu4TzJ8xeI/AAAAAAAAIBo/rW4X1Ymi6D8/SNAGHTML3cdf60b_thumb%25255B2%25255D.png?imgmax=800)
The extension makes new tasks available in task catalogue. SonarQube Scanner CLI allows to analyze PHP, JavaScript etc. projects. New Begin Analysis and End Analysis allows to use with .Net projects analyzing C#, JavaScript etc. as explained in Setup SonarQube Analysis with TFS Builds.
![image image](https://lh3.googleusercontent.com/-p3R6Q5rLL4E/WKu4UQuUwiI/AAAAAAAAIBs/4pECKm8DtVk/image_thumb%25255B13%25255D.png?imgmax=800)
Once a build is setup sonar analysis and queued the build summary provides a link to the analysis results. Quality gate status is shown in the build summary.
![image image](https://lh3.googleusercontent.com/-6Vmnf-aqHJA/WKu4VgNXe-I/AAAAAAAAIB0/9Lk9GeHbCbA/image_thumb%25255B16%25255D.png?imgmax=800)
![SNAGHTML3d6aee5 SNAGHTML3d6aee5](https://lh3.googleusercontent.com/-LPTr2PwL70g/WKu4W1rhf6I/AAAAAAAAIB8/nl5-8CzAL8k/SNAGHTML3d6aee5_thumb%25255B2%25255D.png?imgmax=800)
Link will take you to the Sonar Server details of the analysis. You can drill down each item in the Sonar Server dashboard.
![image image](https://lh3.googleusercontent.com/-dhXjb1r5CYk/WKu4YQqCv8I/AAAAAAAAICE/jt88dAk3G7I/image_thumb%25255B19%25255D.png?imgmax=800)
1 comment:
When running "SonarQube Scanner CLI" vNext build task, I get "Path to tslint.json and tsconfig.json configuration files either not defined or not found" when trying to analyze typescript .ts files. How do you specify tslint.json? I tried specifying a Settings File SonarQube.Analysis.xml with sonar.ts.tslintconfigpath value in Advanced section of the task without success. We have TFS 2015 Update 3 and SonarQube 5.6.6 with SonarTS plugin. Thanks.
Post a Comment