CI: adding support for lockeable resources
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
@@ -31,6 +31,9 @@ def testXMLFile = params.pythonTestXmlFile
|
|||||||
// Name of the test stage
|
// Name of the test stage
|
||||||
def testStageName = params.pipelineTestStageName
|
def testStageName = params.pipelineTestStageName
|
||||||
|
|
||||||
|
// Name of the phone resource
|
||||||
|
def ciSmartPhoneResource = params.smartphonesResource
|
||||||
|
|
||||||
// Terminate Status
|
// Terminate Status
|
||||||
def termUE = 0
|
def termUE = 0
|
||||||
def termENB = 1
|
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: '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')
|
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')
|
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
|
//eNB parameters
|
||||||
string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB')
|
string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB')
|
||||||
@@ -112,6 +116,9 @@ pipeline {
|
|||||||
testStageName = 'Template Test Stage'
|
testStageName = 'Template Test Stage'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.smartphonesResource == null) {
|
||||||
|
allParametersPresent = false
|
||||||
|
}
|
||||||
if (params.eNB_IPAddress == null) {
|
if (params.eNB_IPAddress == null) {
|
||||||
allParametersPresent = false
|
allParametersPresent = false
|
||||||
}
|
}
|
||||||
@@ -178,6 +185,7 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
dir ('ci-scripts') {
|
dir ('ci-scripts') {
|
||||||
|
lock (ciSmartPhoneResource) {
|
||||||
try {
|
try {
|
||||||
echo "\u2705 \u001B[32m${testStageName}\u001B[0m"
|
echo "\u2705 \u001B[32m${testStageName}\u001B[0m"
|
||||||
withCredentials([
|
withCredentials([
|
||||||
@@ -190,6 +198,7 @@ pipeline {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
currentBuild.result = 'FAILURE'
|
currentBuild.result = 'FAILURE'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user