Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team

Introduction

Our claims for CCNet

  • CCNet is no longer developing. It can be used, but in case you want to expand the functionality or fix existing/potential errors, you will have to do that by yourself.
  • The Source Code Management mode is working unstably, namely, for the automatic launch when there are changes in the version control system. In case of problems with the network, in this mode a project gets the status “Failed”, even if it wasn’t run. In practice, the problem occurs so often (sadly, our office doesn’t have the most stable Internet access), that this mode becomes impossible to use.
  • When querying SCM on the edits, in case of an error in the version control system (for example, if some directory was removed from a repository, specified in the settings, causing a tree conflict), the execution of the project will be immediately interrupted; still, the status will be kept “Success” — a project will cease working, but its status will remain “green “ in the web interface and desktop utility. In such a mode the launch of tests can be not done for weeks and there is a risk that no one will pay attention to it, thinking that tests are working correctly.
  • The general server performance log is too verbose and unstructured: it’s hard to understand which step of the build failed and find a log specifically for this step. When running multiple projects in parallel, the build log gets “mixed”. The XML log of the build of a separate project is available in the web interface, but quite often is not really detailed and doesn’t contain all the commands that were run.
  • Inefficient paralleling of subtasks inside a project. The subtasks are run in parallel by groups by the number of the processor cores. If long and quick commands get to the group, then the new tasks won’t be run, until all the tasks from the previous run aren’t completed.

Comparison of usage scenarios

Server settings

<svn>
<username>&SVN_USERNAME;</username>
<password>&SVN_PASSWORD;</password>
<trunkUrl>&SVN_ROOT;...</trunkUrl>
<workingDirectory>&PROJECT_ROOT;...</workingDirectory>
<executable>&SVN_FOLDER;</executable>
<deleteObstructions>true</deleteObstructions>
<cleanUp>true</cleanUp>
<revert>true</revert>
<timeout units="minutes">30</timeout>
</svn>
<msbuild>
<description>PVS-Studio 2015</description>
<workingDirectory>&PROJECT_ROOT;...</workingDirectory>
<projectFile>...\PVS-Studio-vs2015.sln</projectFile>
<buildArgs>/p:Configuration=Release</buildArgs>
<targets>Build</targets>
<timeout>600</timeout>
<executable>&MSBUILD14_PATH;</executable>
</msbuild>
<exec>
<description>PVS-Studio 2015 sign</description>
<executable>&PROJECT_ROOT;...\SignToolWrapper.exe</executable>
<baseDirectory>&PROJECT_ROOT;...</baseDirectory>
<buildArgs>"&SIGNTOOL;" ... \PVS-Studio-vs2015.dll"</buildArgs>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
</exec>
<hudson.tasks.BatchFile>
<command>CD &quot;%BUILD_FOLDERS%\Builder&quot;&#xd;
PVS-Studio_setup.exe /VERYSILENT /SUPPRESSMSGBOXES ...&#xd;
Publisher_setup.exe /VERYSILENT /SUPPRESSMSGBOXES</command>
</hudson.tasks.BatchFile>

View the task statuses

WORKSPACE=$WORKSPACE

Viewing the build logs

Getting the revision of the source code

Useful plugins for Jenkins

  • Multijob plugin- allows using other Jobs as stages of the build with the possibility of sequential and parallel execution.
  • Environment Injector Plugin — a plugin that is used to specify global passwords. They are used as environment variables, and the plugin hides the variable value in the log.
  • Pre SCM BuildStep Plugin — adding extra steps before executing the commands of the version control system.
  • MSBuild Plugin — a handy plugin to build projects using MSBuild. In the settings you specify the paths to different versions of MSBuild only once, later in the project you can easily add build steps.
  • Parameterized Trigger plugin — add parameters of a project launch. For example, you can make a choice of a trunk/stable branch to build a distribution.
  • Post Build Script Plug-in — performing additional steps after the build.
  • Throttle Concurrent Builds Plug-in — this plugin allows adjusting the number of concurrently running project builds either globally or within a specific category. It lets you get the functionality in Jenkins similar to the queues in CCNet — an ability to execute in parallel several projects from different categories (queues), while providing consistent execution of the projects within a single queue. For example, we have Installers queues (distributions) and Tests. We want to have an ability to build some distribution in parallel with running the tests, but at the same time, tests shouldn’t work in parallel — there won’t be enough “cores” on the server.
  • Build Name Setter Plugin — allows specifying the name in a necessary format: Major.Minor.Revision.Build.
  • Dashboard View — allows adding a custom Jobs display in the browser. As we have universal Jobs, that are of no use to run manually, we created a list without them with the help of this plugin.
  • ZenTimestamp Plugin — a handy plugin that adds timestamps in the build logs.

Overview of desktop clients

  • It is not developing, the same as CCNet;
  • Can’t show subtasks (works only for CCNet);
  • Cannot run the projects;
  • You can go to the project page by clicking on the title;
  • Configurable display of projects (Icons, List, Details);
  • Open source.
  • At this moment it is a beta version, the final version will be paid;
  • There are crashes during the setup and work, glitches in the interface;
  • When the PC “wakes up” after the hibernation, the status on the dashboard doesn’t get automatically updated.
  • Can’t show subtasks for Multijobs;
  • Cannot run the projects;
  • The project display is not customizable (the only possible display — figure 6);
  • You can go to the project page by clicking on the title;
  • Ability to view the status of last 5 launches and jump-click to them;
  • Ability to view the progress of the running project;
  • If several servers are added, they are conveniently separated by a line;
  • Versions for Windows, Linux and Mac.
  • Can’t show subtasks for Multijobs;
  • Can run the projects; Unfortunately, does not support projects with a parameterized launch — the utility crashes when trying to run such a project;
  • Projects from different servers are displayed in one list and are not separated in any way (not always convenient);
  • Configurable project display (List, Grid);
  • You can go to the project page by clicking on the title;
  • You can view the latest log directly in the client, but due to lack of monospace text it is not very convenient;
  • Open source.
  • Only for Windows.

Conclusion

--

--

--

The developer, the debugger, the unicorn. I know all about static analysis and how to find bugs and errors in C, C++, C#, and Java source code.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Working with APIs

Why CTOs and HR Departments Choose Drupal for Corporate Intranets

Auto-loading Java Libraries

Review of Music Software Code Defects Part 4. Ardour

build an app using flutter and Firebase

Rethinking Service Blueprints for Agile Delivery

Introducing ParaSwap’s new UI & a significant upgrade for our contracts

How to trim leading and trailing Whitespace from a Text String in C# .NET Framework

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Unicorn Developer

Unicorn Developer

The developer, the debugger, the unicorn. I know all about static analysis and how to find bugs and errors in C, C++, C#, and Java source code.

More from Medium

How to manage secrets in .NET locally and on GitHub? — Maytham Fahmi

Connecting to Aws RDS database with IAM authentication in NHibernate with C# .net

Authentication failed for Azure Git

Convert Office Word Documents (DOCX) to Text in C#