firmware_tools/static_analysis/static_analysis.groovy
2022-01-12 14:57:12 +00:00

70 lines
2.3 KiB
Groovy

pipeline {
agent { label AGENT_LABEL }
stages {
stage('Initial setup') {
steps {
script {
echo "Starting...."
AUTOBUILD_SCRIPTS = "${WORKSPACE}/autobuild"
env.COMMON_SCRIPTS = "${AUTOBUILD_SCRIPTS}/Common_scripts"
githelper = load("${COMMON_SCRIPTS}/versioncontrol/git.groovy")
configurationhelper = load("${COMMON_SCRIPTS}/configuration/configuration.groovy")
configurationhelper.registerPipelineScriptConfiguration()
}
}
}
stage('Clean workspace') {
when {
expression {
"${CLEAN_WORKSPACE}" == "true"
}
}
steps {
// Save any script files that were loaded into the workspace at first and are required after cleaning the workspace
stash allowEmpty: true, includes: 'autobuild/**/*', name: 'Clean workspace stash', useDefaultExcludes: false
cleanWs()
unstash name: 'Clean workspace stash'
}
}
stage('Print server static analysis') {
parallel {
stage('Measure Print Server code complexity') {
steps {
build job: "${PRINT_SERVER_CCM_JOB}"
}
}
stage('Perform Print Server C++ static analysis') {
steps {
build job: "${PRINT_SERVER_CPP_STATIC_ANALYSIS_JOB}"
}
}
stage('Perform Print Server DRY static analysis') {
steps {
build job: "${PRINT_SERVER_DRY_ANALYSIS_JOB}"
}
}
}
}
}
post {
always {
echo 'Post-build'
}
failure {
echo 'Failed build'
/*
step([$class: 'LogParserPublisher',
parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt',
useProjectRule: true
])
*/
}
unstable {
echo 'Unstable build'
}
success {
echo 'Succeeded build'
}
}
}