[DO-736] svace analyze for different arch (!29)
Добавлены параметры для разделения анализов по платформе под сборку. Reviewed-on: https://git.avroid.tech/DevOps/jenkins-pipelines/pulls/29 Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Co-committed-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech>
This commit is contained in:
committed by
Aleksandr Vodyanov
parent
06f19eb426
commit
7d18b08d0b
@@ -27,7 +27,10 @@ properties([
|
||||
string(name: 'BRANCH', defaultValue: ''),
|
||||
string(name: 'COMMIT_SHA', defaultValue: ''),
|
||||
string(name: 'MAIN_BRANCH', defaultValue: 'master'),
|
||||
string(name: 'SVACE_BUILD_RESULTS_LINK', defaultValue: '')
|
||||
string(name: 'SVACE_BUILD_RESULTS_LINK', defaultValue: ''),
|
||||
string(name: 'BUILD_PLATFORM',
|
||||
defaultValue: '',
|
||||
description: 'name, version and arch of build. Example: aurora5_armv7hl')
|
||||
])
|
||||
])
|
||||
|
||||
@@ -40,6 +43,7 @@ node('svace') {
|
||||
println "param COMMIT_SHA ${params.COMMIT_SHA}"
|
||||
println "param SVACE_BUILD_RESULTS_LINK ${params.SVACE_BUILD_RESULTS_LINK}"
|
||||
println "param MAIN_BRANCH ${params.MAIN_BRANCH}"
|
||||
println "param BUILD_PLATFORM ${params.BUILD_PLATFORM}"
|
||||
println "WORKSPACE: ${env.WORKSPACE}"
|
||||
sh 'printenv'
|
||||
}
|
||||
@@ -60,6 +64,14 @@ node('svace') {
|
||||
}
|
||||
|
||||
stage('Svace analyze') {
|
||||
String branch = params.BRANCH
|
||||
String mainBranch = params.MAIN_BRANCH
|
||||
|
||||
if (params.BUILD_PLATFORM) {
|
||||
branch += params.BRANCH
|
||||
mainBranch += params.MAIN_BRANCH
|
||||
}
|
||||
|
||||
sh """
|
||||
tar -xf ${svaceBuildResults}
|
||||
${svaceCmd} config --svace-dir ./${svaceResultsDir} THREAD_NUMBER ${buildThreads}
|
||||
@@ -75,15 +87,18 @@ node('svace') {
|
||||
stage('Upload results') {
|
||||
nexusSvaceSarifRepoPath = "${params.GIT_PROJECT}/${params.BRANCH}/${commitShortSha}"
|
||||
sh """
|
||||
${svaceCmd} svres2sarif ${svaceResultsDir}/.svace-dir/analyze-res/svace_analysis.svres -o ${svaceSarifResultFile}
|
||||
${svaceCmd} svres2sarif \
|
||||
${svaceResultsDir}/.svace-dir/analyze-res/svace_analysis.svres \
|
||||
-o ${svaceSarifResultFile}
|
||||
|
||||
cd ${svaceResultsDir}
|
||||
|
||||
${svacerCmd} import --svace ${svaceCmd} \
|
||||
--project ${params.GIT_PROJECT} \
|
||||
--branch ${params.BRANCH} \
|
||||
--branch ${branch} \
|
||||
--snapshot "${commitShortSha} - `date -R`" \
|
||||
--source-tree ${env.WORKSPACE}/${params.GIT_PROJECT} \
|
||||
--if-no-branch clone-${params.MAIN_BRANCH}
|
||||
--if-no-branch clone-${mainBranch}
|
||||
|
||||
${svacerCmd} upload --ssl \
|
||||
--user ${SVACER_USER} \
|
||||
|
||||
Reference in New Issue
Block a user