From d818101c8c327d8b0d555e95309e66bd0a281305 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 4 Nov 2021 13:15:16 +0100 Subject: [PATCH] feat(ci): triggering NSA B200 Container Sanity Check from parent pipeline Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index b413617580..da85a8a282 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -218,6 +218,26 @@ pipeline { } } } + stage ("NSA B200 Sanity Check") { + when { expression {doMandatoryTests} } + steps { + script { + triggerSlaveJob ('RAN-NSA-B200-Module-LTEBOX-Container', 'Test-NSA-B200') + } + } + post { + always { + script { + finalizeSlaveJob('RAN-NSA-B200-Module-LTEBOX-Container') + } + } + failure { + script { + currentBuild.result = 'FAILURE' + } + } + } + } } } stage ("Images Push to Registries") { @@ -227,8 +247,14 @@ pipeline { triggerSlaveJob ('RAN-DockerHub-Push', 'Push-to-Docker-Hub') } post { + always { + script { + echo "Push to Docker-Hub OK" + } + } failure { script { + echo "Push to Docker-Hub KO" currentBuild.result = 'FAILURE' } } @@ -281,6 +307,11 @@ pipeline { // ---- Slave Job functions def triggerSlaveJob (jobName, gitlabStatusName) { + if ("MERGE".equals(env.gitlabActionType)) { + MR_NUMBER = env.gitlabMergeRequestIid + } else { + MR_NUMBER = 'develop' + } // Workaround for the "cancelled" GitLab pipeline notification // The slave job is triggered with the propagate false so the following commands are executed // Its status is now PASS/SUCCESS from a stage pipeline point of view @@ -290,6 +321,7 @@ def triggerSlaveJob (jobName, gitlabStatusName) { 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)), + string(name: 'eNB_MR', value: String.valueOf(MR_NUMBER)), booleanParam(name: 'eNB_mergeRequest', value: "MERGE".equals(env.gitlabActionType)), string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch)) ], propagate: false @@ -306,6 +338,11 @@ def triggerSlaveJob (jobName, gitlabStatusName) { } def triggerSlaveJobNoGitLab (jobName) { + if ("MERGE".equals(env.gitlabActionType)) { + MR_NUMBER = env.gitlabMergeRequestIid + } else { + MR_NUMBER = 'develop' + } // Workaround for the "cancelled" GitLab pipeline notification // The slave job is triggered with the propagate false so the following commands are executed // Its status is now PASS/SUCCESS from a stage pipeline point of view @@ -315,6 +352,7 @@ def triggerSlaveJobNoGitLab (jobName) { 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)), + string(name: 'eNB_MR', value: String.valueOf(MR_NUMBER)), booleanParam(name: 'eNB_mergeRequest', value: "MERGE".equals(env.gitlabActionType)), string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch)) ], propagate: false