Configuring a Scripted Pipeline

Sigma Documentation

Version
latest
  1. Define a pipeline following the steps in Defining a Jenkins Pipeline. Make sure to select Pipeline script from the Pipeline Definition field in step 3.
  2. Include the following code snippet in the Script text area of the build configuration, making sure to replace the following tokens in the template with actual values.
    • GIT_REPO_URL: This is the URL to the Git repository where the source code is stored.
    • SIGMA_TOOL_NAME: This is the name of the Sigma installation you specified when you configured the Sigma installation.
    Template for using Sigma as a quality gate
    node {
        stage('Clone Repo') {
            git '<GIT_REPO_URL>'
        }
        stage('Sigma') {
            sigma ignorePolicies: false, sigmaToolName: '<SIGMA_TOOL_NAME>'
        }
        stage('Sigma Results') {
            archiveArtifacts 'sigma-results.json'
        }
    }
    Template for using Sigma to report issues within Jenkins
    node {
        stage('Clone Repo') {
            git '<GIT_REPO_URL>'
        }
        stage('Sigma') {
            sigma ignorePolicies: true, sigmaToolName: '<SIGMA_TOOL_NAME>'
        }
        stage('Sigma Results') {
            archiveArtifacts 'sigma-results.json'
            recordIssues(tools: [[$class: 'SigmaTool']])
        }
    }