Commit 9d30c9b0 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: lock mechanism improvement

 -- in slave job, the lock is now properly done for the whole job
 -- in master job, all slave jobs are really sent in parallel
    they should now now appear as failed (if fails)
 cherry-picked from develop (47437903)
Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent cfef9ef0
...@@ -328,200 +328,180 @@ pipeline { ...@@ -328,200 +328,180 @@ pipeline {
} }
} }
} }
stage ("Test on CI bench #1") { stage ("Test FDD - Band 7 - B210") {
stages { steps {
stage ("Test FDD - Band 7 - B210") { script {
steps { if ("MERGE".equals(env.gitlabActionType)) {
script { gitlabCommitStatus(name: "Test-FDD-Band7") {
try { build job: 'eNB-CI-FDD-Band7-B210',
if ("MERGE".equals(env.gitlabActionType)) { parameters: [
gitlabCommitStatus(name: "Test-FDD-Band7") { string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
build job: 'eNB-CI-FDD-Band7-B210', string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
parameters: [ string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), booleanParam(name: 'eNB_mergeRequest', value: true)
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), ]
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), }
booleanParam(name: 'eNB_mergeRequest', value: true) } else {
] gitlabCommitStatus(name: "Test-FDD-Band7") {
} build job: 'eNB-CI-FDD-Band7-B210',
} else { parameters: [
gitlabCommitStatus(name: "Test-FDD-Band7") { string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
build job: 'eNB-CI-FDD-Band7-B210', string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
parameters: [ string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), booleanParam(name: 'eNB_mergeRequest', value: false)
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)), ]
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
} }
} }
post { }
// In case of any non-success, we are retrieving the HTML report of the last completed }
// slave job. post {
// The only drop-back is that we may retrieve the HTML report of a previous build // In case of any non-success, we are retrieving the HTML report of the last completed
always { // slave job.
script { // The only drop-back is that we may retrieve the HTML report of a previous build
if (!fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) { always {
copyArtifacts(projectName: 'eNB-CI-FDD-Band7-B210', script {
filter: 'test_results*.html', if (!fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) {
selector: lastCompleted()) copyArtifacts(projectName: 'eNB-CI-FDD-Band7-B210',
if (fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) { filter: 'test_results*.html',
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-FDD-Band7-B210.html" selector: lastCompleted())
archiveArtifacts artifacts: 'test_results-eNB-CI-FDD-Band7-B210.html' if (fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) {
} sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-FDD-Band7-B210.html"
} archiveArtifacts artifacts: 'test_results-eNB-CI-FDD-Band7-B210.html'
} }
} }
} }
} }
stage ("Test TDD - Band 40 - B210") { }
steps { }
script { stage ("Test TDD - Band 40 - B210") {
try { steps {
if ("MERGE".equals(env.gitlabActionType)) { script {
gitlabCommitStatus(name: "Test-TDD-Band40") { if ("MERGE".equals(env.gitlabActionType)) {
build job: 'eNB-CI-TDD-Band40-B210', gitlabCommitStatus(name: "Test-TDD-Band40") {
parameters: [ build job: 'eNB-CI-TDD-Band40-B210',
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), parameters: [
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
booleanParam(name: 'eNB_mergeRequest', value: true) string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
] booleanParam(name: 'eNB_mergeRequest', value: true)
} ]
} else { }
gitlabCommitStatus(name: "Test-TDD-Band40") { } else {
build job: 'eNB-CI-TDD-Band40-B210', gitlabCommitStatus(name: "Test-TDD-Band40") {
parameters: [ build job: 'eNB-CI-TDD-Band40-B210',
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), parameters: [
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)), string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)), string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
booleanParam(name: 'eNB_mergeRequest', value: false) string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
] booleanParam(name: 'eNB_mergeRequest', value: false)
} ]
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
} }
} }
post { }
// In case of any non-success, we are retrieving the HTML report of the last completed }
// slave job. post {
// The only drop-back is that we may retrieve the HTML report of a previous build // In case of any non-success, we are retrieving the HTML report of the last completed
always { // slave job.
script { // The only drop-back is that we may retrieve the HTML report of a previous build
if (!fileExists('test_results-eNB-CI-TDD-Band40-B210.html')) { always {
copyArtifacts(projectName: 'eNB-CI-TDD-Band40-B210', script {
filter: 'test_results*.html', if (!fileExists('test_results-eNB-CI-TDD-Band40-B210.html')) {
selector: lastCompleted()) copyArtifacts(projectName: 'eNB-CI-TDD-Band40-B210',
if (fileExists('test_results-eNB-CI-TDD-Band40-B210.html')) { filter: 'test_results*.html',
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-TDD-Band40-B210.html" selector: lastCompleted())
archiveArtifacts artifacts: 'test_results-eNB-CI-TDD-Band40-B210.html' if (fileExists('test_results-eNB-CI-TDD-Band40-B210.html')) {
} sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-TDD-Band40-B210.html"
} archiveArtifacts artifacts: 'test_results-eNB-CI-TDD-Band40-B210.html'
} }
} }
} }
} }
stage ("Test IF4p5 - FDD - Band 7 - B210") { }
steps { }
script { stage ("Test IF4p5 - FDD - Band 7 - B210") {
try { steps {
if ("MERGE".equals(env.gitlabActionType)) { script {
gitlabCommitStatus(name: "Test-IF4p5-FDD-Band7") { if ("MERGE".equals(env.gitlabActionType)) {
build job: 'eNB-CI-IF4p5-FDD-Band7-B210', gitlabCommitStatus(name: "Test-IF4p5-FDD-Band7") {
parameters: [ build job: 'eNB-CI-IF4p5-FDD-Band7-B210',
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), parameters: [
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
booleanParam(name: 'eNB_mergeRequest', value: true) string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
] booleanParam(name: 'eNB_mergeRequest', value: true)
} ]
} else { }
gitlabCommitStatus(name: "Test-IF4p5-FDD-Band7") { } else {
build job: 'eNB-CI-IF4p5-FDD-Band7-B210', gitlabCommitStatus(name: "Test-IF4p5-FDD-Band7") {
parameters: [ build job: 'eNB-CI-IF4p5-FDD-Band7-B210',
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), parameters: [
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)), string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)), string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
booleanParam(name: 'eNB_mergeRequest', value: false) string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
] booleanParam(name: 'eNB_mergeRequest', value: false)
} ]
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
} }
} }
post { }
// In case of any non-success, we are retrieving the HTML report of the last completed }
// slave job. post {
// The only drop-back is that we may retrieve the HTML report of a previous build // In case of any non-success, we are retrieving the HTML report of the last completed
always { // slave job.
script { // The only drop-back is that we may retrieve the HTML report of a previous build
if (!fileExists('test_results-eNB-CI-IF4p5-FDD-Band7-B210.html')) { always {
copyArtifacts(projectName: 'eNB-CI-IF4p5-FDD-Band7-B210', script {
filter: 'test_results*.html', if (!fileExists('test_results-eNB-CI-IF4p5-FDD-Band7-B210.html')) {
selector: lastCompleted()) copyArtifacts(projectName: 'eNB-CI-IF4p5-FDD-Band7-B210',
if (fileExists('test_results-eNB-CI-IF4p5-FDD-Band7-B210.html')) { filter: 'test_results*.html',
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-IF4p5-FDD-Band7-B210.html" selector: lastCompleted())
archiveArtifacts artifacts: 'test_results-eNB-CI-IF4p5-FDD-Band7-B210.html' if (fileExists('test_results-eNB-CI-IF4p5-FDD-Band7-B210.html')) {
} sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-IF4p5-FDD-Band7-B210.html"
} archiveArtifacts artifacts: 'test_results-eNB-CI-IF4p5-FDD-Band7-B210.html'
} }
} }
} }
} }
stage ("Test IF4p5 - TDD - Band 40 - B210") { }
steps { }
script { stage ("Test IF4p5 - TDD - Band 40 - B210") {
try { steps {
if ("MERGE".equals(env.gitlabActionType)) { script {
gitlabCommitStatus(name: "Test-IF4p5-TDD-Band40") { if ("MERGE".equals(env.gitlabActionType)) {
build job: 'eNB-CI-IF4p5-TDD-Band40-B210', gitlabCommitStatus(name: "Test-IF4p5-TDD-Band40") {
parameters: [ build job: 'eNB-CI-IF4p5-TDD-Band40-B210',
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), parameters: [
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
booleanParam(name: 'eNB_mergeRequest', value: true) string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
] booleanParam(name: 'eNB_mergeRequest', value: true)
} ]
} else { }
gitlabCommitStatus(name: "Test-IF4p5-TDD-Band40") { } else {
build job: 'eNB-CI-IF4p5-TDD-Band40-B210', gitlabCommitStatus(name: "Test-IF4p5-TDD-Band40") {
parameters: [ build job: 'eNB-CI-IF4p5-TDD-Band40-B210',
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), parameters: [
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)), string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)), string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
booleanParam(name: 'eNB_mergeRequest', value: false) string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
] booleanParam(name: 'eNB_mergeRequest', value: false)
} ]
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
}
} }
} }
post { }
// In case of any non-success, we are retrieving the HTML report of the last completed }
// slave job. post {
// The only drop-back is that we may retrieve the HTML report of a previous build // In case of any non-success, we are retrieving the HTML report of the last completed
always { // slave job.
script { // The only drop-back is that we may retrieve the HTML report of a previous build
if (!fileExists('test_results-eNB-CI-IF4p5-TDD-Band40-B210.html')) { always {
copyArtifacts(projectName: 'eNB-CI-IF4p5-TDD-Band40-B210', script {
filter: 'test_results*.html', if (!fileExists('test_results-eNB-CI-IF4p5-TDD-Band40-B210.html')) {
selector: lastCompleted()) copyArtifacts(projectName: 'eNB-CI-IF4p5-TDD-Band40-B210',
if (fileExists('test_results-eNB-CI-IF4p5-TDD-Band40-B210.html')) { filter: 'test_results*.html',
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-IF4p5-TDD-Band40-B210.html" selector: lastCompleted())
archiveArtifacts artifacts: 'test_results-eNB-CI-IF4p5-TDD-Band40-B210.html' if (fileExists('test_results-eNB-CI-IF4p5-TDD-Band40-B210.html')) {
} sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-IF4p5-TDD-Band40-B210.html"
} archiveArtifacts artifacts: 'test_results-eNB-CI-IF4p5-TDD-Band40-B210.html'
} }
} }
} }
......
...@@ -61,6 +61,7 @@ pipeline { ...@@ -61,6 +61,7 @@ pipeline {
options { options {
disableConcurrentBuilds() disableConcurrentBuilds()
ansiColor('xterm') ansiColor('xterm')
lock (ciSmartPhoneResource)
} }
// the following parameter options are commented out so it shows the ones // the following parameter options are commented out so it shows the ones
// that you SHALL have to run the job. // that you SHALL have to run the job.
...@@ -184,7 +185,6 @@ pipeline { ...@@ -184,7 +185,6 @@ 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([
...@@ -197,7 +197,6 @@ pipeline { ...@@ -197,7 +197,6 @@ pipeline {
} catch (Exception e) { } catch (Exception e) {
currentBuild.result = 'FAILURE' 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