Commit 67c089cd authored by Raphael Defosseux's avatar Raphael Defosseux

CI: adding support for lockeable resources

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent b8f6d254
......@@ -31,6 +31,9 @@ def testXMLFile = params.pythonTestXmlFile
// Name of the test stage
def testStageName = params.pipelineTestStageName
// Name of the phone resource
def ciSmartPhoneResource = params.smartphonesResource
// Terminate Status
def termUE = 0
def termENB = 1
......@@ -70,6 +73,7 @@ pipeline {
string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run')
string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage')
booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact')
string(name: 'smartphonesResource', defaultValue: 'CI-Bench-1-Phones', description: 'Lockeable Resource to prevent multiple jobs to run simultaneously with the same resource')
//eNB parameters
string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB')
......@@ -112,6 +116,9 @@ pipeline {
testStageName = 'Template Test Stage'
}
if (params.smartphonesResource == null) {
allParametersPresent = false
}
if (params.eNB_IPAddress == null) {
allParametersPresent = false
}
......@@ -178,6 +185,7 @@ pipeline {
steps {
script {
dir ('ci-scripts') {
lock (ciSmartPhoneResource) {
try {
echo "\u2705 \u001B[32m${testStageName}\u001B[0m"
withCredentials([
......@@ -190,6 +198,7 @@ pipeline {
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment