Declarative pipeline syntax example
pipeline {
agent any
stages {
stage("BlackDuckSecruityScan") {
steps {
script {
def status = security_scan product: "srm", srm_url: "SRM_URL",
srm_apikey: "YOUR_SRM_APIKEY", srm_assessment_types: "SCA,SAST",
srm_project_name: 'SRM_PROJECT_NAME'
//, mark_build_status: 'UNSTABLE'
// Uncomment to add custom logic based on return status
// if (status == 8) { unstable 'policy violation' }
// else if (status != 0) { error 'plugin failure' }
}
}
}
}
}
Scripted pipeline syntax example
node {
checkout scm
stage("BlackDuckSecruityScan") {
def status = security_scan product: "srm", srm_url: "SRM_URL",
srm_apikey: "YOUR_SRM_APIKEY", srm_assessment_types: "SCA,SAST",
srm_project_name: 'SRM_PROJECT_NAME'
// , mark_build_status: 'UNSTABLE'
// Uncomment to add custom logic based on return status
// if (status == 8) { unstable 'policy violation' }
// else if (status != 0) { error 'plugin failure' }
}
}