Commit 0ed77d63 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: simplify master pipeline

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 191f11a0
...@@ -408,44 +408,13 @@ pipeline { ...@@ -408,44 +408,13 @@ pipeline {
stage ("Test MONOLITHIC - FDD - Band 7 - B210") { stage ("Test MONOLITHIC - FDD - Band 7 - B210") {
steps { steps {
script { script {
if ("MERGE".equals(env.gitlabActionType)) { triggerSlaveJob ('eNB-CI-FDD-Band7-B210', 'Test-Mono-FDD-Band7')
gitlabCommitStatus(name: "Test-Mono-FDD-Band7") {
build job: 'eNB-CI-FDD-Band7-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
}
} else {
gitlabCommitStatus(name: "Test-Mono-FDD-Band7") {
build job: 'eNB-CI-FDD-Band7-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
} }
} }
post { post {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always { always {
script { script {
if (!fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) { finalizeSlaveJob('eNB-CI-FDD-Band7-B210')
copyArtifacts(projectName: 'eNB-CI-FDD-Band7-B210',
filter: 'test_results*.html',
selector: lastCompleted())
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'
}
}
} }
} }
failure { failure {
...@@ -458,44 +427,13 @@ pipeline { ...@@ -458,44 +427,13 @@ pipeline {
stage ("Test MONOLITHIC - TDD - Band 40 - B210") { stage ("Test MONOLITHIC - TDD - Band 40 - B210") {
steps { steps {
script { script {
if ("MERGE".equals(env.gitlabActionType)) { triggerSlaveJob ('eNB-CI-TDD-Band40-B210', 'Test-Mono-TDD-Band40')
gitlabCommitStatus(name: "Test-Mono-TDD-Band40") {
build job: 'eNB-CI-TDD-Band40-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
}
} else {
gitlabCommitStatus(name: "Test-Mono-TDD-Band40") {
build job: 'eNB-CI-TDD-Band40-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
} }
} }
post { post {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always { always {
script { script {
if (!fileExists('test_results-eNB-CI-TDD-Band40-B210.html')) { finalizeSlaveJob('eNB-CI-TDD-Band40-B210')
copyArtifacts(projectName: 'eNB-CI-TDD-Band40-B210',
filter: 'test_results*.html',
selector: lastCompleted())
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'
}
}
} }
} }
failure { failure {
...@@ -508,44 +446,13 @@ pipeline { ...@@ -508,44 +446,13 @@ pipeline {
stage ("Test IF4p5 - FDD - Band 7 - B210") { stage ("Test IF4p5 - FDD - Band 7 - B210") {
steps { steps {
script { script {
if ("MERGE".equals(env.gitlabActionType)) { triggerSlaveJob ('eNB-CI-IF4p5-FDD-Band7-B210', 'Test-IF4p5-FDD-Band7')
gitlabCommitStatus(name: "Test-IF4p5-FDD-Band7") {
build job: 'eNB-CI-IF4p5-FDD-Band7-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
}
} else {
gitlabCommitStatus(name: "Test-IF4p5-FDD-Band7") {
build job: 'eNB-CI-IF4p5-FDD-Band7-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
} }
} }
post { post {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always { always {
script { script {
if (!fileExists('test_results-eNB-CI-IF4p5-FDD-Band7-B210.html')) { finalizeSlaveJob('eNB-CI-IF4p5-FDD-Band7-B210')
copyArtifacts(projectName: 'eNB-CI-IF4p5-FDD-Band7-B210',
filter: 'test_results*.html',
selector: lastCompleted())
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'
}
}
} }
} }
failure { failure {
...@@ -558,44 +465,13 @@ pipeline { ...@@ -558,44 +465,13 @@ pipeline {
stage ("Test IF4p5 - TDD - Band 40 - B210") { stage ("Test IF4p5 - TDD - Band 40 - B210") {
steps { steps {
script { script {
if ("MERGE".equals(env.gitlabActionType)) { triggerSlaveJob ('eNB-CI-IF4p5-TDD-Band40-B210', 'Test-IF4p5-TDD-Band40')
gitlabCommitStatus(name: "Test-IF4p5-TDD-Band40") {
build job: 'eNB-CI-IF4p5-TDD-Band40-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
}
} else {
gitlabCommitStatus(name: "Test-IF4p5-TDD-Band40") {
build job: 'eNB-CI-IF4p5-TDD-Band40-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
} }
} }
post { post {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always { always {
script { script {
if (!fileExists('test_results-eNB-CI-IF4p5-TDD-Band40-B210.html')) { finalizeSlaveJob('eNB-CI-IF4p5-TDD-Band40-B210')
copyArtifacts(projectName: 'eNB-CI-IF4p5-TDD-Band40-B210',
filter: 'test_results*.html',
selector: lastCompleted())
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'
}
}
} }
} }
failure { failure {
...@@ -608,44 +484,13 @@ pipeline { ...@@ -608,44 +484,13 @@ pipeline {
stage ("Test MONOLITHIC - FDD - Band 13 - B210") { stage ("Test MONOLITHIC - FDD - Band 13 - B210") {
steps { steps {
script { script {
if ("MERGE".equals(env.gitlabActionType)) { triggerSlaveJob ('eNB-CI-MONO-FDD-Band13-B210', 'Test-Mono-FDD-Band13')
gitlabCommitStatus(name: "Test-Mono-FDD-Band13") {
build job: 'eNB-CI-MONO-FDD-Band13-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
}
} else {
gitlabCommitStatus(name: "Test-Mono-FDD-Band13") {
build job: 'eNB-CI-MONO-FDD-Band13-B210',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
} }
} }
post { post {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always { always {
script { script {
if (!fileExists('test_results-eNB-CI-MONO-FDD-Band13-B210.html')) { finalizeSlaveJob('eNB-CI-MONO-FDD-Band13-B210')
copyArtifacts(projectName: 'eNB-CI-MONO-FDD-Band13-B210',
filter: 'test_results*.html',
selector: lastCompleted())
if (fileExists('test_results-eNB-CI-MONO-FDD-Band13-B210.html')) {
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-MONO-FDD-Band13-B210.html"
archiveArtifacts artifacts: 'test_results-eNB-CI-MONO-FDD-Band13-B210.html'
}
}
} }
} }
failure { failure {
...@@ -655,70 +500,19 @@ pipeline { ...@@ -655,70 +500,19 @@ pipeline {
} }
} }
} }
stage ("Test OAI UE Sniffing - FDD - Band 20 - B200") { stage ("Test OAI UE - FDD - Bands 20/7 - B200") {
steps { steps {
script { script {
if ("MERGE".equals(env.gitlabActionType)) { triggerSlaveJobNoGitLab ('UE-CI-FDD-Band20-B200')
//gitlabCommitStatus(name: "Test-OAI-UE-FDD-Band20") {
build job: 'UE-CI-FDD-Band20-B200',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
//}
} else {
//gitlabCommitStatus(name: "Test-OAI-UE-FDD-Band20") {
build job: 'UE-CI-FDD-Band20-B200',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
//}
}
// calling a second job sequentially // calling a second job sequentially
if ("MERGE".equals(env.gitlabActionType)) { triggerSlaveJob ('eNB-UE-CI-MONO-FDD-Band7-B200', 'Test-eNB-OAI-UE-FDD-Band7')
gitlabCommitStatus(name: "Test-eNB-OAI-UE-FDD-Band7") {
build job: 'eNB-UE-CI-MONO-FDD-Band7-B200',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
}
} else {
gitlabCommitStatus(name: "Test-eNB-OAI-UE-FDD-Band7") {
build job: 'eNB-UE-CI-MONO-FDD-Band7-B200',
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
} }
} }
post { post {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
always { always {
script { script {
if (!fileExists('test_results-eNB-UE-CI-MONO-FDD-Band7-B200.html')) { finalizeSlaveJob('UE-CI-FDD-Band20-B200')
copyArtifacts(projectName: 'eNB-UE-CI-MONO-FDD-Band7-B200', finalizeSlaveJob('eNB-UE-CI-MONO-FDD-Band7-B200')
filter: 'test_results*.html',
selector: lastCompleted())
if (fileExists('test_results-eNB-UE-CI-MONO-FDD-Band7-B200.html')) {
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-UE-CI-MONO-FDD-Band7-B200.html"
archiveArtifacts artifacts: 'test_results-eNB-UE-CI-MONO-FDD-Band7-B200.html'
}
}
} }
} }
failure { failure {
...@@ -806,3 +600,66 @@ OAI CI Team''', ...@@ -806,3 +600,66 @@ OAI CI Team''',
} }
} }
} }
// ---- Slave Job functions
def triggerSlaveJob (jobName, gitlabStatusName) {
if ("MERGE".equals(env.gitlabActionType)) {
gitlabCommitStatus(name: gitlabStatusName) {
build job: jobName,
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
}
} else {
gitlabCommitStatus(name: gitlabStatusName) {
build job: jobName,
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
}
def triggerSlaveJobNoGitLab (jobName) {
if ("MERGE".equals(env.gitlabActionType)) {
build job: jobName,
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: true),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
]
} else {
build job: jobName,
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
booleanParam(name: 'eNB_mergeRequest', value: false)
]
}
}
def finalizeSlaveJob(jobName) {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
fileName = "test_results-${jobName}.html"
if (!fileExists(fileName)) {
copyArtifacts(projectName: jobName,
filter: 'test_results*.html',
selector: lastCompleted())
if (fileExists(fileName)) {
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}"
archiveArtifacts artifacts: fileName
}
}
}
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