Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
f7618a97
Commit
f7618a97
authored
Sep 29, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce documentation step in RAN-Container-Parent, separate 4G and 5G
parent
ffe2202f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
42 deletions
+61
-42
ci-scripts/Jenkinsfile-GitLab-Container
ci-scripts/Jenkinsfile-GitLab-Container
+31
-26
ci-scripts/Jenkinsfile-gitlab
ci-scripts/Jenkinsfile-gitlab
+1
-1
ci-scripts/checkGitLabMergeRequestLabels.sh
ci-scripts/checkGitLabMergeRequestLabels.sh
+29
-15
No files found.
ci-scripts/Jenkinsfile-GitLab-Container
View file @
f7618a97
...
...
@@ -24,8 +24,9 @@
def
nodeExecutor
=
params
.
nodeExecutor
// Tags to shorten pipeline duration
def
doMandatoryTests
=
false
def
doFullTestsuite
=
false
def
doBuild
=
true
def
do4Gtest
=
false
def
do5Gtest
=
false
//
def
gitCommitAuthorEmailAddr
...
...
@@ -56,26 +57,30 @@ pipeline {
LABEL_CHECK
=
sh
returnStdout:
true
,
script:
'ci-scripts/checkGitLabMergeRequestLabels.sh --mr-id '
+
env
.
gitlabMergeRequestIid
LABEL_CHECK
=
LABEL_CHECK
.
trim
()
if
(
LABEL_CHECK
==
'NONE'
)
{
def
message
=
"OAI "
+
JOB_NAME
+
" build ("
+
BUILD_ID
+
"): Your merge request has none of the mandatory labels:\n\n"
message
+=
" - BUILD-ONLY\n"
message
+=
" - 4G-LTE\n"
message
+=
" - 5G-NR\n"
message
+=
" - CI\n\n"
def
message
=
"OAI "
+
JOB_NAME
+
" build ("
+
BUILD_ID
+
"): Your merge request should have one of the mandatory labels:\n\n"
message
+=
" - ~documentation (don't perform any stages)\n"
message
+=
" - ~BUILD-ONLY (execute only build stages)\n"
message
+=
" - ~4G-LTE (perform 4G tests)\n"
message
+=
" - ~5G-NR (perform 5G tests)\n"
message
+=
" - ~CI (perform both 4G and 5G tests)\n\n"
message
+=
"Not performing CI due to lack of labels"
addGitLabMRComment
comment:
message
error
(
'Not performing CI due to lack of labels'
)
}
else
if
(
LABEL_CHECK
==
'FULL'
)
{
doMandatoryTests
=
true
doFullTestsuite
=
true
do4Gtest
=
true
do5Gtest
=
true
}
else
if
(
LABEL_CHECK
==
"SHORTEN-4G"
)
{
do4Gtest
=
true
}
else
if
(
LABEL_CHECK
==
'SHORTEN-5G'
)
{
doMandatoryTests
=
true
do5Gtest
=
true
}
else
if
(
LABEL_CHECK
==
'documentation'
)
{
doBuild
=
false
}
else
{
def
message
=
"OAI "
+
JOB_NAME
+
" build ("
+
BUILD_ID
+
"): We will perform only build stages on your Merge Request"
addGitLabMRComment
comment:
message
// is "BUILD-ONLY", will only build
}
}
else
{
do
MandatoryTests
=
true
do
FullTestsuite
=
true
do
4Gtest
=
true
do
5Gtest
=
true
}
}
}
...
...
@@ -116,6 +121,7 @@ pipeline {
// Build Stages are Mandatory
// Later we will add a Ubuntu20 build
stage
(
"Image Building Processes"
)
{
when
{
expression
{
doBuild
}
}
parallel
{
stage
(
"Ubuntu18-Image-Builder"
)
{
steps
{
...
...
@@ -177,9 +183,10 @@ pipeline {
}
}
stage
(
"Image Test Processes"
)
{
when
{
expression
{
doBuild
}
}
parallel
{
stage
(
"PhySim-Cluster"
)
{
when
{
expression
{
do
MandatoryTests
}
}
when
{
expression
{
do
4Gtest
||
do5Gtest
}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-PhySim-Cluster'
,
'PhySim-Cluster'
)
...
...
@@ -199,7 +206,7 @@ pipeline {
}
}
stage
(
"RF-Sim-Test-4G"
)
{
when
{
expression
{
do
MandatoryTests
}
}
when
{
expression
{
do
4Gtest
}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-RF-Sim-Test-4G'
,
'RF-Sim-Test-4G'
)
...
...
@@ -219,7 +226,7 @@ pipeline {
}
}
stage
(
"RF-Sim-Test-5G"
)
{
when
{
expression
{
do
MandatoryTests
}
}
when
{
expression
{
do
5Gtest
}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-RF-Sim-Test-5G'
,
'RF-Sim-Test-5G'
)
...
...
@@ -239,7 +246,7 @@ pipeline {
}
}
stage
(
"L2-Sim-Test-4G"
)
{
when
{
expression
{
do
MandatoryTests
}
}
when
{
expression
{
do
4Gtest
}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-L2-Sim-Test-4G'
,
'L2-Sim-Test-4G'
)
...
...
@@ -259,7 +266,7 @@ pipeline {
}
}
stage
(
"L2-Sim-Test-5G"
)
{
when
{
expression
{
do
MandatoryTests
}
}
when
{
expression
{
do
5Gtest
}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-L2-Sim-Test-5G'
,
'L2-Sim-Test-5G'
)
...
...
@@ -279,7 +286,7 @@ pipeline {
}
}
stage
(
"NSA-B200-Module-LTEBOX-Container"
)
{
when
{
expression
{
do
MandatoryTests
}
}
when
{
expression
{
do
4Gtest
||
do5Gtest
}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-NSA-B200-Module-LTEBOX-Container'
,
'NSA-B200-Module-LTEBOX-Container'
)
...
...
@@ -299,7 +306,7 @@ pipeline {
}
}
stage
(
"NSA-B200-Module-SABOX-Container"
)
{
when
{
expression
{
do
MandatoryTests
}
}
when
{
expression
{
do
5Gtest
}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-SA-B200-Module-SABOX-Container'
,
'NSA-B200-Module-SABOX-Container'
)
...
...
@@ -319,7 +326,7 @@ pipeline {
}
}
stage
(
"gNB-N300-Timing-Phytest-LDPC"
)
{
when
{
expression
{
do
MandatoryTests
}
}
when
{
expression
{
do
5Gtest
}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-gNB-N300-Timing-Phytest-LDPC'
,
'gNB-N300-Timing-Phytest-LDPC'
)
...
...
@@ -340,7 +347,7 @@ pipeline {
}
//avra is offline, re-enable once it is available
//stage ("T1-Offload-Test") {
// when { expression {do
MandatoryTests
} }
// when { expression {do
5Gtest
} }
// steps {
// script {
// triggerSlaveJob ('RAN-T1-Offload-Test', 'T1-Offload-Test')
...
...
@@ -362,7 +369,7 @@ pipeline {
}
}
stage
(
"DockerHub-Push"
)
{
when
{
expression
{
"PUSH"
.
equals
(
env
.
gitlabActionType
)}
}
when
{
expression
{
doBuild
&&
"PUSH"
.
equals
(
env
.
gitlabActionType
)}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-DockerHub-Push'
,
'DockerHub-Push'
)
...
...
@@ -401,7 +408,6 @@ pipeline {
script
{
def
message
=
"OAI "
+
JOB_NAME
+
" build ("
+
BUILD_ID
+
"): passed ("
+
BUILD_URL
+
")"
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
echo
"This is a MERGE event"
addGitLabMRComment
comment:
message
}
echo
"Pipeline is SUCCESSFUL"
...
...
@@ -411,7 +417,6 @@ pipeline {
script
{
def
message
=
"OAI "
+
JOB_NAME
+
" build ("
+
BUILD_ID
+
"): failed ("
+
BUILD_URL
+
")"
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
echo
"This is a MERGE event"
addGitLabMRComment
comment:
message
}
echo
"Pipeline FAILED"
...
...
ci-scripts/Jenkinsfile-gitlab
View file @
f7618a97
...
...
@@ -82,7 +82,7 @@ pipeline {
message
+=
"Not performing CI due to lack of labels"
addGitLabMRComment
comment:
message
error
(
'Not performing CI due to lack of labels'
)
}
else
if
(
LABEL_CHECK
==
'FULL'
)
{
}
else
if
(
LABEL_CHECK
==
'FULL'
||
LABEL_CHECK
==
'SHORTEN-4G'
)
{
doMandatoryTests
=
true
doFullTestsuite
=
true
}
else
if
(
LABEL_CHECK
==
'SHORTEN-5G'
)
{
...
...
ci-scripts/checkGitLabMergeRequestLabels.sh
View file @
f7618a97
...
...
@@ -73,36 +73,50 @@ done
LABELS
=
`
curl
--silent
"https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/
$MERGE_REQUEST_ID
"
| jq
'.labels'
||
true
`
IS_MR_BUILD_ONLY
=
`
echo
$LABELS
|
grep
-c
BUILD-ONLY
||
true
`
IS_MR_CI
=
`
echo
$LABELS
|
grep
-c
CI
||
true
`
IS_MR_4G
=
`
echo
$LABELS
|
grep
-c
4G-LTE
||
true
`
IS_MR_5G
=
`
echo
$LABELS
|
grep
-c
5G-NR
||
true
`
IS_MR_DOCUMENTATION
=
`
echo
$LABELS
|
grep
-c
Documentation
`
IS_MR_BUILD_ONLY
=
`
echo
$LABELS
|
grep
-c
BUILD-ONLY
`
IS_MR_CI
=
`
echo
$LABELS
|
grep
-c
CI
`
IS_MR_4G
=
`
echo
$LABELS
|
grep
-c
4G-LTE
`
IS_MR_5G
=
`
echo
$LABELS
|
grep
-c
5G-NR
`
#
First case:
none is present! No CI
if
[
$IS_MR_BUILD_ONLY
-eq
0
]
&&
[
$IS_MR_CI
-eq
0
]
&&
[
$IS_MR_4G
-eq
0
]
&&
[
$IS_MR_5G
-eq
0
]
# none is present! No CI
if
[
$IS_MR_BUILD_ONLY
-eq
0
]
&&
[
$IS_MR_CI
-eq
0
]
&&
[
$IS_MR_4G
-eq
0
]
&&
[
$IS_MR_5G
-eq
0
]
&&
[
$IS_MR_DOCUMENTATION
-eq
0
]
then
echo
"NONE"
exit
0
fi
#
Second case: Build-Only
if
[
$IS_MR_
BUILD_ONLY
-eq
1
]
#
4G and 5G or CI labels: run everything (4G, 5G)
if
[
$IS_MR_
4G
-eq
1
]
&&
[
$IS_MR_5G
-eq
1
]
||
[
$IS_MR_CI
-eq
1
]
then
echo
"
BUILD-ONLY
"
echo
"
FULL
"
exit
0
fi
#
Third case: CI or 4G label --> Full CI run
if
[
$IS_MR_4G
-eq
1
]
||
[
$IS_MR_CI
-eq
1
]
#
4G is present: run only 4G
if
[
$IS_MR_4G
-eq
1
]
then
echo
"
FULL
"
exit
0
echo
"
SHORTEN-4G
"
exit
1
fi
#
Fourth case: 5G label
if
[
$IS_MR_
BUILD_ONLY
-eq
0
]
&&
[
$IS_MR_CI
-eq
0
]
&&
[
$IS_MR_4G
-eq
0
]
&&
[
$IS_MR_
5G
-eq
1
]
#
5G is present: run only 5G
if
[
$IS_MR_5G
-eq
1
]
then
echo
"SHORTEN-5G"
exit
0
fi
# BUILD-ONLY is present: only build stages
if
[
$IS_MR_BUILD_ONLY
-eq
1
]
then
echo
"BUILD-ONLY"
exit
0
fi
# Documentation is present: don't do anything
if
[
$IS_MR_DOCUMENTATION
-eq
1
]
then
echo
"documentation"
exit
1
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment