I've used Jenkins CI for a few years and I want learn TeamCity.
In Jenkins I tracked FxCop issues by enabling code analysis on my .net projects and then telling the Violations plugin where to find the code analysis XML files i.e. MSBUILD would put a file named [project name].CodeAnalysisLog.xml in the build output directory and you could use something like **/*/*CodeAnalysisLog.xml to find those files with the Violations plugin.
TeamCity has its own FxCop runner but I don't want to run FxCop again because MSBuild has already done that for me.
I just want to be able to tell TeamCity where to find the XML files and have it produce the trend graph in the same way Jenkins does with the Violations plugin.
I have a similar issue with StyleCop, jsLint and cssLint. MSBuild build tasks or batch commands that run as part of the build produce XML output. I would like to use this output to create trend graphs.
To my knowledge TeamCity is different from Jenkins for the reports in a sense that it takes them in HTML format. That's what we have had to do for our code quality analysis product - convert our XML report to HTML for TeamCity. Due to that we can't do violation trend report when integrated with TeamCity unlike the Jenkins plug-in we have. We haven't looked whether there were TeamCity changes in the last couple of years that would enable the XML report input.
Related
I'm trying to get SonarQube setup on our tfs build server and it keeps stopping the scan after pre-processing succeeds. I'm using the MSBuild.SonarQube.Runner.exe. There are no error messages at all. No indication that anything has gone wrong. I'm not sure where to go from here. Halp?
There's nothing wrong in what you see as the output. You are just missing some bits and pieces.
The “begin” invocation sets up the SonarQube analysis. Mandatory
analysis settings such as the SonarQube project key, name and version
must be passed in, as well as any optional settings, such as paths to
code coverage reports. During this phase, the scanner fetches the
quality profile and settings to be used from the SonarQube server.
Then, you build your project as you would typically do. As the build
happens, the SonarQube Scanner for MSBuild gathers the exact set of
projects and source files being compiled and analyzes them.
Finally, during the “end” invocation, remaining analysis data such as
Git or TFVC one is gathered, and the overall results are sent to the
SonarQube server.
Source
In short, after the first command call (begin), you need to run MSBuild 14.0 and build your solution, then finish up the invocation (end) and see the analysis results in your SonarQube server, if everything went all right.
# This is part of the pre-build script
> MSBuild.SonarQube.Runner.exe begin /k:project_key /n:project_name /v:project_version
# Build your solution here
> msbuild /t:rebuild
# This is part of the post-build script
> MSBuild.SonarQube.Runner.exe end
That small script should be part of your build pipeline (using Jenkins, TeamCity, or whatever CI tool) ideally.
Hope this helps!
I'm testing SonarQube with a .Net solution file. I'm trying to figure out which files exactly get uploaded/imported into the SonarQube database. Based on my tests with the SonarQube MSBuild runner, it analysis and uploads all files which are stated in the .csproj project file(s) (only those that can be associated with a language plugin because I have set "Import unknown files" to false).
Is there a way to specify additional files which should be analyzed and imported? I had some hope for the "sonar.inclusions" setting, but it's not exactly what I need because the description says Patterns used to include some source files and only these ones in analysis.
I'd like to just specify additional files.
My use-case: at the moment, SonarQube does not create issues for compiler warnings (see Displaying C# compilation warnings in Sonar?) (which in my opinion is really sad/weird for a tool that wants to improve code quality). So my idea is to use msbuild with an xml-logger, import the generated xml log file and use the XML plugin with custom XML path rules to extract the compiler messages.
Similar issue for analyzing Delphi code. I found an old SonarQube Delphi plugin which I could not yet get to work with SonarQube 5.x, but I'd like to try to get at least the compiler messages into SonarQube (convert Delphi compiler output into XML, get SonarQube to import this file, use custom XML path rules).
Is there a way to get SonarQube to analyze/import such additional files?
How can we combine different build reports in team city?
Consider all builds are chained and final job will show report of all jobs in chain.
You can configure artifact dependencies from the last build configuration in the build chain to all needed build configurations. So all the reports will be downloaded by the last build configuration.
If the reports are in HTML format you can publish it as TeamCity artifact and configure Report tab to make the reports available as an extra tabs on the build or project level.
Another approach is to use XML Report processing build feature that allows using report files produced by an external tool in TeamCity. TeamCity will parse the specified files on the disk and report the results as the build results.
For more details see how to present data in TeamCity in the documentation.
I was wondering if someone would be able to explain what Build runners do and also what i would need to use for just a static HTML / CSS / JS site, or even an already compiled .NET site.
I will be hooking up each project to its equiv SVN and grabbing updates from there, but not 100% sure what the build runners do or which i should use as technically i dont need to build the site.
Sorry it may be too much to answer but i am just struggling to get my head round Team City
Thank you
Build runners are just a process for a specific task, for example the MSBuild runner is set up by putting information into specific fields which it then uses to call MSBuild on the target build agent. You could just as easily use the Command Line runner and build up the MSBuild run command manually.
Build runner is a part of TeamCity that allows integration with a
specific build tool (Ant, MSBuild, Command line, etc.). In a build
configuration, the build runner defines how to run a build and report
its results. Each build runner has two parts:
server-side settings that are configured through the web UI
agent-side part that executes a build on agent
You need to choose your runner depending on the task that you want to do and the technology that you have wrapped your project in. If there is no runner for your specific task then you can use the lowest common denominator which would be the Command Line runner.
The way I approach this would be to see how I can achieve what I want to from my own environment be that calling a rake, MSBuild or batch file. I then see how I can then apply that to a tool. Do not create a process around a tool but choose a tool that fits to your process.
We use the build in coverage application in TeamCity 6 (about to upgrade to 7.1)
If we wish to see the code coverage (or other metrics) of a particular build it is fine as we can navigate to that build, but it would be great if we could pluck out a few interesting metrics from all/some of the current projects/build configurations and display them all together.
For convenience I would expect the new display to be accessible from within TeamCity itself, however if there are solutions that require a separate solution we could look at them.
If you want to compare a set of common metrics (e.g. code coverage) across different projects and over time then SonarQube is probably what you want.
You can integrate it with TeamCity by adding a sonar-project.properties file to each project and calling sonar-runner from a command line build step.