Jenkins

Prerequisites

    Install Jenkins for your platform
    Setup project to scan

Instructions for SCA scans

    Add a new script build step in your Jenkins project as shown in the below screenshot
    Copy the following and use it in the above build step by replacing
      lang - java | python | node |PHP | go | rust | dotnet
      api-key - your API key
      project-name - your project name
NOTE: for node language, uncomment commented outline as per instructions.
1
stage('Scan') {
2
steps {
3
sh "curl https://raw.githubusercontent.com/CloudDefenseAI/cd/master/latest/cd-latest-linux-x64.tar.gz > /tmp/cd-latest-linux-x64.tar.gz && tar -C /tmp -xzf /tmp/cd-latest-linux-x64.tar.gz && chmod +x /tmp/cdefense"
4
# NOTE: uncomment the below line for when language is node
5
# sh "npm install -g license-checker"
6
sh "/tmp/cdefense scan --lang=<project_programming_language> --api-key=<API_KEY> --project-name=<project-name>"
7
}
8
}
Copied!
​
Last modified 1mo ago