Skip to content

Latest commit

 

History

History
78 lines (55 loc) · 1.78 KB

integration_basic.md

File metadata and controls

78 lines (55 loc) · 1.78 KB

Basic integration of SCA into jenkins

This document describes the integration of SCA into jenkins

Prerequisites

Using pipeline

In a pipeline simply insert the following

post {
    always {
        recordIssues aggregatingResults: true, tools: [checkStyle pattern: "**/checkstyle/*.xml")]
    }
}

to reduce the lookup time for files you could also do

def deployDir = "$WORKSPACE/tmp/deploy/images/**";

post {
    always {
        recordIssues aggregatingResults: true, tools: [checkStyle pattern: "$deployDir/sca/checkstyle/*.xml")]
    }
}

Results

At the project view in jenkins a run would look like this

project view

At the particular build it would look like this

build view

If you now click on 'CheckStyle Warnings' the following is shown

details_1

If you now click on the tab 'Categories' you will see all the results from your enabled tools, with their findings

details_2

Now you can browse through the findings (and expand the section) to view the notice given by the particular tool

details_3

Full example of pipeline

/* Alter this path if needed */
def deployDir = "$WORKSPACE/tmp/deploy/images/**";

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                echo "Replace this by the build command you are using!"
            }
        }
    }
    post {
       always {
            recordIssues aggregatingResults: true, tools: [checkStyle(pattern: "$deployDir/sca/checkstyle/*.xml")]
       }
    }
}