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 ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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([
...@@ -194,6 +202,7 @@ pipeline { ...@@ -194,6 +202,7 @@ pipeline {
} }
} }
} }
}
stage ("Terminate") { stage ("Terminate") {
parallel { parallel {
stage('Terminate UE') { stage('Terminate UE') {
......
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