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 |
Continuous integration tools allow for easy incorporation of CodeSonar into the development cycle. In most cases little or no configuration is required.
| 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. |
In many cases, using CodeSonar with a continuous integration tool entails the following three steps.
For example, suppose we have a software project called MyProj and a CodeSonar hub running at alexmachine:7340.
| Suppose MyProj is written in... | ...and the continuous integration tool invokes the regular build with... | ...then: |
|---|---|---|
| C or C++ | make normal |
Replace
make normal codesonar analyze MyProj -foreground alexmachine:7340 make normal |
| Java |
ant compile
(With source files in directory sources and output written to directory buildoutput/classes.) |
Augment
ant compile ant compile codesonar analyze MyProj -foreground alexmachine:7340 cs-java-scan -include-artifacts buildoutput/classes -include-sources sources |
In most cases, your determination will concern the warnings issued by the analysis. For example, a "pass" determination might require that the analysis report no warnings at all, or that it not report any new warnings (that is, warnings that are not present in some designated baseline analysis). You can use a script to download web GUI pages in order to make this determination: we provide a number of annotated download script examples that you may find helpful.
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.
Suppose that the CodeSonar hub that the continuous integration tool will use is located at host:port.
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:
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.
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/.