-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'matousek-feat-lockable-jenkins-resources' into 'devel'
Support for lockable Jenkins resources See merge request ndk/ndk-app-minimal!55
- Loading branch information
Showing
4 changed files
with
134 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
/* | ||
* ver.jenkins: Jenkins configuration script | ||
* Copyright (C) 2021 CESNET z. s. p. o. | ||
* Author(s): Radek Iša <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
// Clean previous builds | ||
library 'liberouter' | ||
cleanBuilds() | ||
|
||
|
||
// ///////////////////////////////////////////////////////////////////////////// | ||
// MULTI-VERIFICATION | ||
// ///////////////////////////////////////////////////////////////////////////// | ||
// [ 'name' , 'path_to_ver' , 'fdo_file.fdo' , 'test_pkg.sv/.vhd' , 'settings.py' ] | ||
// ['FULL_SPEED' , 'app/uvm' , 'top_level.fdo' , 'test_pkg.vhd' , 'ver_settings.py' ],\ | ||
def COMPONENTS_MULTIVER = [\ | ||
['BASE' , 'app/uvm' , 'top_level.fdo' , 'test_pkg.sv' , 'ver_settings.py' ],\ | ||
] | ||
// ///////////////////////////////////////////////////////////////////////////// | ||
// Run component verifications using common script | ||
node('preklad') { | ||
// fetch sources from GIT | ||
checkout scm | ||
def common_run = load "ndk/ofm/tests/jenkins/common.jenkins" | ||
def root_path = pwd() | ||
common_run.commonPrekladMultiVerRun(COMPONENTS_MULTIVER, "$root_path/ndk/ofm") | ||
} | ||
/* | ||
* ver.jenkins: Jenkins configuration script | ||
* Copyright (C) 2021 CESNET z. s. p. o. | ||
* Author(s): Radek Iša <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
// Clean previous builds | ||
library 'liberouter' | ||
cleanBuilds() | ||
|
||
|
||
// ///////////////////////////////////////////////////////////////////////////// | ||
// MULTI-VERIFICATION | ||
// ///////////////////////////////////////////////////////////////////////////// | ||
// [ 'name' , 'path_to_ver' , 'fdo_file.fdo' , 'test_pkg.sv/.vhd' , 'settings.py' ] | ||
// ['FULL_SPEED' , 'app/uvm' , 'top_level.fdo' , 'test_pkg.vhd' , 'ver_settings.py' ],\ | ||
def COMPONENTS_MULTIVER = [\ | ||
['BASE' , 'app/uvm' , 'top_level.fdo' , 'test_pkg.sv' , 'ver_settings.py' ],\ | ||
] | ||
// ///////////////////////////////////////////////////////////////////////////// | ||
// Run component verifications using common script | ||
node('preklad') { | ||
lock(label:"resources-${env.NODE_NAME}", quantity: 1) { | ||
// fetch sources from GIT | ||
checkout scm | ||
def common_run = load "ndk/ofm/tests/jenkins/common.jenkins" | ||
def root_path = pwd() | ||
common_run.commonPrekladMultiVerRun(COMPONENTS_MULTIVER, "$root_path/ndk/ofm") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,61 +26,62 @@ properties([ | |
|
||
// Jenkins configuration for multiple modules | ||
node('preklad') { | ||
lock(label:"resources-${env.NODE_NAME}", quantity: 1) { | ||
// Clean old builds | ||
cleanBuilds() | ||
|
||
// Clean old builds | ||
cleanBuilds() | ||
// fetch sources from GIT | ||
checkout scm | ||
// clean artifacts possibly left by previous builds | ||
sh "git clean -df" | ||
|
||
// fetch sources from GIT | ||
checkout scm | ||
// clean artifacts possibly left by previous builds | ||
sh "git clean -df" | ||
|
||
def failed = [] | ||
// run verification of every component | ||
withEnv(["PATH+VSIM=/usr/local/fpga/Modeltech/linux_x86_64", '[email protected]']) { | ||
for(c in COMPONENTS) { | ||
// parse | ||
def name = c[0] | ||
def path = c[1] | ||
def fdo = c[2] | ||
def pkg = c[3] | ||
def settings = c[4] | ||
def repo_root = pwd() | ||
def multi_ver = "$repo_root/ndk/ofm/build/scripts/multi_ver/multi_ver.py" | ||
// exec vsim | ||
try { // try-catch is a hack to continue even after the first failed verification | ||
timeout(time: 12, unit: 'HOURS') { | ||
stage("$name") { | ||
dir("$path") { | ||
sh "python3 $multi_ver $fdo $pkg $settings" | ||
def failed = [] | ||
// run verification of every component | ||
withEnv(["PATH+VSIM=/usr/local/fpga/Modeltech/linux_x86_64", '[email protected]']) { | ||
for(c in COMPONENTS) { | ||
// parse | ||
def name = c[0] | ||
def path = c[1] | ||
def fdo = c[2] | ||
def pkg = c[3] | ||
def settings = c[4] | ||
def repo_root = pwd() | ||
def multi_ver = "$repo_root/ndk/ofm/build/scripts/multi_ver/multi_ver.py" | ||
// exec vsim | ||
try { // try-catch is a hack to continue even after the first failed verification | ||
timeout(time: 12, unit: 'HOURS') { | ||
stage("$name") { | ||
dir("$path") { | ||
sh "python3 $multi_ver $fdo $pkg $settings" | ||
} | ||
} | ||
} | ||
} catch(err) { | ||
currentBuild.result = 'FAILURE' // still propagate failure status to Jenkins | ||
failed.add("$name") | ||
} finally { // collect interesting files | ||
archiveArtifacts "$path/transcript*" // verification log | ||
} | ||
} catch(err) { | ||
currentBuild.result = 'FAILURE' // still propagate failure status to Jenkins | ||
failed.add("$name") | ||
} finally { // collect interesting files | ||
archiveArtifacts "$path/transcript*" // verification log | ||
} | ||
} | ||
} | ||
|
||
// send out emails if failure is detected | ||
if(currentBuild.result == "FAILURE") { | ||
println "FAILED on components: ${failed}." | ||
emailext \ | ||
recipientProviders: [culprits(), developers()], | ||
to: '[email protected]', | ||
subject: "[Jenkins] ${currentBuild.currentResult} ${env.JOB_NAME} #${currentBuild.number}", | ||
body: """\ | ||
The build of the repository ${env.JOB_NAME} #${currentBuild.number} ends up with status ${currentBuild.currentResult} on components: ${failed}. You can find build log in the attachments. | ||
// send out emails if failure is detected | ||
if(currentBuild.result == "FAILURE") { | ||
println "FAILED on components: ${failed}." | ||
emailext \ | ||
recipientProviders: [culprits(), developers()], | ||
to: '[email protected]', | ||
subject: "[Jenkins] ${currentBuild.currentResult} ${env.JOB_NAME} #${currentBuild.number}", | ||
body: """\ | ||
The build of the repository ${env.JOB_NAME} #${currentBuild.number} ends up with status ${currentBuild.currentResult} on components: ${failed}. You can find build log in the attachments. | ||
|
||
For more details see ${env.BUILD_URL}. | ||
For more details see ${env.BUILD_URL}. | ||
|
||
Yours sincerely | ||
Jenkins\ | ||
""".stripIndent(), | ||
attachLog: true, | ||
compressLog: true | ||
Yours sincerely | ||
Jenkins\ | ||
""".stripIndent(), | ||
attachLog: true, | ||
compressLog: true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,61 +26,62 @@ properties([ | |
|
||
// Jenkins configuration for multiple modules | ||
node('preklad') { | ||
lock(label:"resources-${env.NODE_NAME}", quantity: 1) { | ||
// Clean old builds | ||
cleanBuilds() | ||
|
||
// Clean old builds | ||
cleanBuilds() | ||
// fetch sources from GIT | ||
checkout scm | ||
// clean artifacts possibly left by previous builds | ||
sh "git clean -df" | ||
|
||
// fetch sources from GIT | ||
checkout scm | ||
// clean artifacts possibly left by previous builds | ||
sh "git clean -df" | ||
|
||
def failed = [] | ||
// run verification of every component | ||
withEnv(["PATH+VSIM=/usr/local/fpga/Modeltech/linux_x86_64", '[email protected]']) { | ||
for(c in COMPONENTS) { | ||
// parse | ||
def name = c[0] | ||
def path = c[1] | ||
def fdo = c[2] | ||
def pkg = c[3] | ||
def settings = c[4] | ||
def repo_root = pwd() | ||
def multi_ver = "$repo_root/ndk/ofm/build/scripts/multi_ver/multi_ver.py" | ||
// exec vsim | ||
try { // try-catch is a hack to continue even after the first failed verification | ||
timeout(time: 4, unit: 'DAYS') { | ||
stage("$name") { | ||
dir("$path") { | ||
sh "python3 $multi_ver $fdo $pkg $settings" | ||
def failed = [] | ||
// run verification of every component | ||
withEnv(["PATH+VSIM=/usr/local/fpga/Modeltech/linux_x86_64", '[email protected]']) { | ||
for(c in COMPONENTS) { | ||
// parse | ||
def name = c[0] | ||
def path = c[1] | ||
def fdo = c[2] | ||
def pkg = c[3] | ||
def settings = c[4] | ||
def repo_root = pwd() | ||
def multi_ver = "$repo_root/ndk/ofm/build/scripts/multi_ver/multi_ver.py" | ||
// exec vsim | ||
try { // try-catch is a hack to continue even after the first failed verification | ||
timeout(time: 4, unit: 'DAYS') { | ||
stage("$name") { | ||
dir("$path") { | ||
sh "python3 $multi_ver $fdo $pkg $settings" | ||
} | ||
} | ||
} | ||
} catch(err) { | ||
currentBuild.result = 'FAILURE' // still propagate failure status to Jenkins | ||
failed.add("$name") | ||
} finally { // collect interesting files | ||
archiveArtifacts "$path/transcript*" // verification log | ||
} | ||
} catch(err) { | ||
currentBuild.result = 'FAILURE' // still propagate failure status to Jenkins | ||
failed.add("$name") | ||
} finally { // collect interesting files | ||
archiveArtifacts "$path/transcript*" // verification log | ||
} | ||
} | ||
} | ||
|
||
// send out emails if failure is detected | ||
if(currentBuild.result == "FAILURE") { | ||
println "FAILED on components: ${failed}." | ||
emailext \ | ||
recipientProviders: [culprits(), developers()], | ||
to: '[email protected]', | ||
subject: "[Jenkins] ${currentBuild.currentResult} ${env.JOB_NAME} #${currentBuild.number}", | ||
body: """\ | ||
The build of the repository ${env.JOB_NAME} #${currentBuild.number} ends up with status ${currentBuild.currentResult} on components: ${failed}. You can find build log in the attachments. | ||
// send out emails if failure is detected | ||
if(currentBuild.result == "FAILURE") { | ||
println "FAILED on components: ${failed}." | ||
emailext \ | ||
recipientProviders: [culprits(), developers()], | ||
to: '[email protected]', | ||
subject: "[Jenkins] ${currentBuild.currentResult} ${env.JOB_NAME} #${currentBuild.number}", | ||
body: """\ | ||
The build of the repository ${env.JOB_NAME} #${currentBuild.number} ends up with status ${currentBuild.currentResult} on components: ${failed}. You can find build log in the attachments. | ||
|
||
For more details see ${env.BUILD_URL}. | ||
For more details see ${env.BUILD_URL}. | ||
|
||
Yours sincerely | ||
Jenkins\ | ||
""".stripIndent(), | ||
attachLog: true, | ||
compressLog: true | ||
Yours sincerely | ||
Jenkins\ | ||
""".stripIndent(), | ||
attachLog: true, | ||
compressLog: true | ||
} | ||
} | ||
} |