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
3e51fcdf
Commit
3e51fcdf
authored
Nov 15, 2024
by
Raphael Defosseux
Committed by
Robert Schmidt
Nov 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: Provide possibility to pass in flexricTag
parent
df9aec16
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
ci-scripts/Jenkinsfile-tmp-ran
ci-scripts/Jenkinsfile-tmp-ran
+12
-4
ci-scripts/args_parse.py
ci-scripts/args_parse.py
+3
-0
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+5
-3
No files found.
ci-scripts/Jenkinsfile-tmp-ran
View file @
3e51fcdf
...
...
@@ -58,6 +58,8 @@ def eNB_CommitID
def
eNB_AllowMergeRequestProcess
=
false
def
eNB_TargetBranch
def
flexricOption
=
""
pipeline
{
agent
{
label
pythonExecutor
...
...
@@ -148,6 +150,13 @@ pipeline {
allParametersPresent
=
false
}
if
(
params
.
Flexric_Tag
!=
null
)
{
echo
"This pipeline is configured to run with a FlexRIC deployment."
echo
"Appending FlexRicTag option to the list of options"
flexricOption
=
"--FlexRicTag=${params.Flexric_Tag}"
echo
"Using new Flexric option: ${flexricOption}"
}
if
(
allParametersPresent
)
{
echo
"All parameters are present"
if
(
eNB_AllowMergeRequestProcess
)
{
...
...
@@ -158,8 +167,7 @@ pipeline {
sh
"git checkout -f ${eNB_CommitID}"
}
}
else
{
echo
"Some parameters are missing"
sh
"./ci-scripts/fail.sh"
error
"Some parameters are missing"
}
}
}
...
...
@@ -190,13 +198,13 @@ pipeline {
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.eNB_Credentials}"
,
usernameVariable:
'eNB_Username'
,
passwordVariable:
'eNB_Password'
],
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.EPC_Credentials}"
,
usernameVariable:
'EPC_Username'
,
passwordVariable:
'EPC_Password'
],
])
{
sh
"python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${mainPythonAllXmlFiles}"
sh
"python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${
flexricOption} ${
mainPythonAllXmlFiles}"
String
[]
myXmlTestSuite
=
testXMLFile
.
split
(
"\\r?\\n"
)
for
(
xmlFile
in
myXmlTestSuite
)
{
if
(
fileExists
(
xmlFile
))
{
try
{
timeout
(
time:
60
,
unit:
'MINUTES'
)
{
sh
"python3 main.py --mode=TesteNB --
eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch
} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile}"
sh
"python3 main.py --mode=TesteNB --
ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${flexricOption} --eNBIPAddress=${params.eNB_IPAddress
} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile}"
}
}
catch
(
Exception
e
)
{
currentBuild
.
result
=
'FAILURE'
...
...
ci-scripts/args_parse.py
View file @
3e51fcdf
...
...
@@ -264,6 +264,9 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER):
elif
re
.
match
(
'^\-\-BuildId=(.+)$'
,
myArgv
,
re
.
IGNORECASE
):
matchReg
=
re
.
match
(
'^\-\-BuildId=(.+)$'
,
myArgv
,
re
.
IGNORECASE
)
RAN
.
BuildId
=
matchReg
.
group
(
1
)
elif
re
.
match
(
'^\-\-FlexRicTag=(.+)$'
,
myArgv
,
re
.
IGNORECASE
):
matchReg
=
re
.
match
(
'^\-\-FlexRicTag=(.+)$'
,
myArgv
,
re
.
IGNORECASE
)
CONTAINERS
.
flexricTag
=
matchReg
.
group
(
1
)
else
:
HELP
.
GenericHelp
(
CONST
.
Version
)
sys
.
exit
(
'Invalid Parameter: '
+
myArgv
)
...
...
ci-scripts/cls_containerize.py
View file @
3e51fcdf
...
...
@@ -176,10 +176,10 @@ def ExistEnvFilePrint(ssh, wd, prompt='env vars in existing'):
logging
.
info
(
f'
{
prompt
}
{
wd
}
/.env:
{
env_vars
}
'
)
return
True
def
WriteEnvFile
(
ssh
,
services
,
wd
,
tag
):
def
WriteEnvFile
(
ssh
,
services
,
wd
,
tag
,
flexric_tag
):
ret
=
ssh
.
run
(
f'cat
{
wd
}
/.env'
,
silent
=
True
,
reportNonZero
=
False
)
registry
=
"oai-ci"
# pull_images() gives us this registry path
envs
=
{
"REGISTRY"
:
registry
,
"TAG"
:
tag
}
envs
=
{
"REGISTRY"
:
registry
,
"TAG"
:
tag
,
"FLEXRIC_TAG"
:
flexric_tag
}
if
ret
.
returncode
==
0
:
# it exists, we have to update
# transforms env file to dictionary
old_envs
=
{}
...
...
@@ -340,6 +340,8 @@ class Containerize():
#checkers from xml
self
.
ran_checkers
=
{}
self
.
flexricTag
=
''
#-----------------------------------------------------------
# Container management functions
#-----------------------------------------------------------
...
...
@@ -859,7 +861,7 @@ class Containerize():
return
False
ExistEnvFilePrint
(
ssh
,
wd
)
WriteEnvFile
(
ssh
,
services
,
wd
,
self
.
deploymentTag
)
WriteEnvFile
(
ssh
,
services
,
wd
,
self
.
deploymentTag
,
self
.
flexricTag
)
logging
.
info
(
f"will start services
{
services
}
"
)
status
=
ssh
.
run
(
f'docker compose -f
{
wd
}
/docker-compose.y*ml up -d --
{
services
}
'
)
...
...
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