JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
General

Using CodeSonar With Continuous Integration Tools

Continuous integration tools allow for easy incorporation of CodeSonar into the development cycle. In most cases little or no configuration is required.



Tool-Specific Notes

Buildbot Follow the typical setup instructions.
CruiseControl Follow the typical setup instructions.
Gerrit See CodeSonar-Gerrit Pipeline Integration: Installation and Examples.
Hudson See Using CodeSonar With Hudson.
Jenkins See CodeSonar Jenkins integration documentation.

Typical Setup

In many cases, using CodeSonar with a continuous integration tool entails the following three steps.

Running a Launch Daemon

In general, using CodeSonar with a continuous integration tool requires that the analysis machine be running a CodeSonar launch daemon (cslaunchd) with the same owner as the continuous integration tool process.

We provide instructions for running the launch daemon on Windows and on other systems.

[Windows] Setting Up A Launch Daemon Service

  1. If the hub is not currently running, start it.
  2. Determine the owner of the continuous integration tool process (for example, by checking the Windows Task Manager).
  3. Does the analysis machine already have a cslaunchd service with the same owner?
  4. Get a command prompt as this owner. The method for getting a command prompt depends on whether the owner is SYSTEM, or a Windows user account.
  5. A new console window will open. In this new window, execute the following command to start the configuration tool.
    codesonar config
  6. In the configuration tool main menu, select Install, connect to existing hub and work through the guided steps to connect to the hub at host:port.
  7. Provide authentication for the service when prompted to do so.

[other systems] Starting the Launch Daemon At System Startup

Suppose that the CodeSonar hub that the continuous integration tool will use is located at host:port.

  1. Determine the owner of the continuous integration tool process (for example, by executing TOP).
  2. Arrange for that user account to run the following command on the analysis machine at system startup.
    codesonar install-launchd host:port
    Depending on your hub's access controls, you may need extend the command to specify user credentials for a hub user account with permission to start a launch daemon. For details, see Hub Authentication: Authenticated codesonar Subcommands.

    The exact mechanism used to run the command at system startup will depend on the tools and commands available on your system. Read your system documentation or consult your system administrator for information and instructions. Good candidates include:

Running CodeSonar in Docker

You can run CodeSonar inside Docker. The following caveats apply.

We provide a Dockerfile at $CSONAR/codesonar/docker/Dockerfile

Comments in the Dockerfile explain how to use it and describe the various adjustments that you will need to make to your CodeSonar analysis. Read these comments before using the Dockerfile or otherwise attempting to run CodeSonar inside Docker.

Note: CodeSonar 9.0 introduced substantial changes to the shipped Dockerfile, including changes to how the the Dockerfile is invoked. If you have been using Docker with an earlier CodeSonar version and are now upgrading, consult the Dockerfile comments to determine what changes you need to make.

codesonar_citool.py

The codesonar_citool.py wrapper supports running the CodeSonar build/analysis in a continuous integration (CI) context and performing specified checks on the analysis results.
For details, see codesonar_citool.py: A Wrapper for CI Contexts.

 

To report problems with this documentation, please visit https://support.codesecure.com/.