Commit 4ff2c4e7 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/ci-improve-jenkins-ux' into integration_2023_w40

parents e160e083 f9ab9ca1
...@@ -31,6 +31,9 @@ def do5Gtest = false ...@@ -31,6 +31,9 @@ def do5Gtest = false
// //
def gitCommitAuthorEmailAddr def gitCommitAuthorEmailAddr
// list of failing stages
def failingStages = ""
pipeline { pipeline {
agent { agent {
label nodeExecutor label nodeExecutor
...@@ -130,12 +133,13 @@ pipeline { ...@@ -130,12 +133,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-Ubuntu18-Image-Builder') testBullet = finalizeSlaveJob('RAN-Ubuntu18-Image-Builder')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -149,12 +153,13 @@ pipeline { ...@@ -149,12 +153,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-RHEL8-Cluster-Image-Builder') testBullet = finalizeSlaveJob('RAN-RHEL8-Cluster-Image-Builder')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -168,12 +173,13 @@ pipeline { ...@@ -168,12 +173,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-cppcheck') testBullet = finalizeSlaveJob('RAN-cppcheck')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -193,12 +199,13 @@ pipeline { ...@@ -193,12 +199,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-PhySim-Cluster') testBullet = finalizeSlaveJob('RAN-PhySim-Cluster')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -213,12 +220,13 @@ pipeline { ...@@ -213,12 +220,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-RF-Sim-Test-4G') testBullet = finalizeSlaveJob('RAN-RF-Sim-Test-4G')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -233,12 +241,13 @@ pipeline { ...@@ -233,12 +241,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-RF-Sim-Test-5G') testBullet = finalizeSlaveJob('RAN-RF-Sim-Test-5G')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -253,12 +262,13 @@ pipeline { ...@@ -253,12 +262,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-L2-Sim-Test-4G') testBullet = finalizeSlaveJob('RAN-L2-Sim-Test-4G')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -273,12 +283,13 @@ pipeline { ...@@ -273,12 +283,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-L2-Sim-Test-5G') testBullet = finalizeSlaveJob('RAN-L2-Sim-Test-5G')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -293,12 +304,13 @@ pipeline { ...@@ -293,12 +304,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-LTE-FDD-LTEBOX-Container') testBullet = finalizeSlaveJob('RAN-LTE-FDD-LTEBOX-Container')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -314,12 +326,13 @@ pipeline { ...@@ -314,12 +326,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-LTE-FDD-OAIUE-OAICN4G-Container') testBullet = finalizeSlaveJob('RAN-LTE-FDD-OAIUE-OAICN4G-Container')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -334,12 +347,13 @@ pipeline { ...@@ -334,12 +347,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-LTE-TDD-LTEBOX-Container') testBullet = finalizeSlaveJob('RAN-LTE-TDD-LTEBOX-Container')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -354,12 +368,13 @@ pipeline { ...@@ -354,12 +368,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-NSA-B200-Module-LTEBOX-Container') testBullet = finalizeSlaveJob('RAN-NSA-B200-Module-LTEBOX-Container')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -374,12 +389,13 @@ pipeline { ...@@ -374,12 +389,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-SA-B200-Module-SABOX-Container') testBullet = finalizeSlaveJob('RAN-SA-B200-Module-SABOX-Container')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -394,12 +410,13 @@ pipeline { ...@@ -394,12 +410,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-gNB-N300-Timing-Phytest-LDPC') testBullet = finalizeSlaveJob('RAN-gNB-N300-Timing-Phytest-LDPC')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -414,12 +431,13 @@ pipeline { ...@@ -414,12 +431,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-LTE-TDD-2x2-Container') testBullet = finalizeSlaveJob('RAN-LTE-TDD-2x2-Container')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -434,12 +452,13 @@ pipeline { ...@@ -434,12 +452,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-SA-AW2S-CN5G') testBullet = finalizeSlaveJob('RAN-SA-AW2S-CN5G')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -454,12 +473,13 @@ pipeline { ...@@ -454,12 +473,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-Interop-F1') testBullet = finalizeSlaveJob('RAN-Interop-F1')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -474,12 +494,13 @@ pipeline { ...@@ -474,12 +494,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('OAI-CN5G-COTS-UE-Test') testBullet = finalizeSlaveJob('OAI-CN5G-COTS-UE-Test')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -494,12 +515,13 @@ pipeline { ...@@ -494,12 +515,13 @@ pipeline {
post { post {
always { always {
script { script {
finalizeSlaveJob('RAN-SA-OAIUE-CN5G') testBullet = finalizeSlaveJob('RAN-SA-OAIUE-CN5G')
} }
} }
failure { failure {
script { script {
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += testBullet
} }
} }
} }
...@@ -518,6 +540,7 @@ pipeline { ...@@ -518,6 +540,7 @@ pipeline {
script { script {
echo "Push to Docker-Hub KO" echo "Push to Docker-Hub KO"
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
failingStages += '\n * RAN-DockerHub-Push'
} }
} }
} }
...@@ -541,7 +564,8 @@ pipeline { ...@@ -541,7 +564,8 @@ pipeline {
script { script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")" def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) { if ("MERGE".equals(env.gitlabActionType)) {
addGitLabMRComment comment: message def fullMessage = message + '\n\nList of failing test stages:' + failingStages
addGitLabMRComment comment: fullMessage
def message2 = message + " -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")" def message2 = message + " -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
sendSocialMediaMessage('ci-enb', 'danger', message2) sendSocialMediaMessage('ci-enb', 'danger', message2)
} else { } else {
...@@ -651,6 +675,7 @@ def finalizeSlaveJob(jobName) { ...@@ -651,6 +675,7 @@ def finalizeSlaveJob(jobName) {
} else { } else {
fileName = "test_results-${jobName}.html" fileName = "test_results-${jobName}.html"
} }
artifactUrl = BUILD_URL
if (!fileExists(fileName)) { if (!fileExists(fileName)) {
copyArtifacts(projectName: jobName, copyArtifacts(projectName: jobName,
filter: 'test_results*.html', filter: 'test_results*.html',
...@@ -658,8 +683,13 @@ def finalizeSlaveJob(jobName) { ...@@ -658,8 +683,13 @@ def finalizeSlaveJob(jobName) {
if (fileExists(fileName)) { if (fileExists(fileName)) {
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}" sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}"
archiveArtifacts artifacts: fileName archiveArtifacts artifacts: fileName
// BUILD_URL is like http://server:port/jenkins/job/foo/15/
// no need to add a prefixed '/'
artifactUrl += 'artifact/' + fileName
} }
} }
artifactUrl = "\n * [${jobName}](${artifactUrl})"
return artifactUrl
} }
// Abstraction function to send social media messages: // Abstraction function to send social media messages:
......
...@@ -67,6 +67,13 @@ pipeline { ...@@ -67,6 +67,13 @@ pipeline {
} }
stages { stages {
stage("Build Init") {
steps {
// update the build name and description
buildName "${params.eNB_MR}"
buildDescription "Branch : ${params.eNB_Branch}"
}
}
stage ('Verify Parameters') { stage ('Verify Parameters') {
steps { steps {
script { script {
......
...@@ -61,6 +61,13 @@ pipeline { ...@@ -61,6 +61,13 @@ pipeline {
} }
stages { stages {
stage("Build Init") {
steps {
// update the build name and description
buildName "${params.eNB_MR}"
buildDescription "Branch : ${params.eNB_Branch}"
}
}
stage ('Verify Parameters') { stage ('Verify Parameters') {
steps { steps {
script { script {
......
...@@ -61,6 +61,13 @@ pipeline { ...@@ -61,6 +61,13 @@ pipeline {
} }
stages { stages {
stage("Build Init") {
steps {
// update the build name and description
buildName "${params.eNB_MR}"
buildDescription "Branch : ${params.eNB_Branch}"
}
}
stage ('Verify Parameters') { stage ('Verify Parameters') {
steps { steps {
script { script {
......
...@@ -66,6 +66,13 @@ pipeline { ...@@ -66,6 +66,13 @@ pipeline {
} }
stages { stages {
stage("Build Init") {
steps {
// update the build name and description
buildName "${params.eNB_MR}"
buildDescription "Branch : ${params.eNB_Branch}"
}
}
stage ("Verify Parameters") { stage ("Verify Parameters") {
steps { steps {
script { script {
......
...@@ -54,6 +54,13 @@ pipeline { ...@@ -54,6 +54,13 @@ pipeline {
lock(extra: lockResources) lock(extra: lockResources)
} }
stages { stages {
stage("Build Init") {
steps {
// update the build name and description
buildName "${params.eNB_MR}"
buildDescription "Branch : ${params.eNB_Branch}"
}
}
stage ("Verify Parameters") { stage ("Verify Parameters") {
steps { steps {
script { script {
......
...@@ -66,32 +66,14 @@ pipeline { ...@@ -66,32 +66,14 @@ pipeline {
ansiColor('xterm') ansiColor('xterm')
lock(extra: lockResources) lock(extra: lockResources)
} }
// the following parameter options are commented out so it shows the ones
// that you SHALL have to run the job.
// You can use them as template
/*
parameters {
//node-test parameters
string(name: 'pythonExecutor', defaultValue: 'nodea', description: 'Node where the pipeline - python scripts will be executed')
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: 'lockResources', 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')
credentials(name: 'eNB_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for eNB')
string(name: 'eNB_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of eNB source code')
//EPC parameters
string(name: 'EPC_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of EPC')
string(name: 'EPC_Type', defaultValue: 'ltebox', description: 'EPC type: OAI or ltebox')
credentials(name: 'EPC_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for EPC')
string(name: 'EPC_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of EPC source code')
}
*/
stages { stages {
stage("Build Init") {
steps {
// update the build name and description
buildName "${params.eNB_MR}"
buildDescription "Branch : ${params.eNB_Branch}"
}
}
stage ("Verify Parameters") { stage ("Verify Parameters") {
steps { steps {
script { script {
......
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