Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
cn5g
oai-cn5g-fed
Commits
da00013b
Commit
da00013b
authored
May 26, 2021
by
ismail
Browse files
CI: updated to get the each pods log
Signed-off-by:
ismail
<
mohammed.ismail@openairinterface.org
>
parent
6ec513d7
Changes
5
Hide whitespace changes
Inline
Side-by-side
charts/oai-nrf/values.yaml
View file @
da00013b
...
...
@@ -9,7 +9,7 @@ namespace: "PROJECT"
image
:
registry
:
local
repository
:
image-registry.openshift-image-registry.svc:5000/PROJECT/oai-nrf
version
:
TAG
version
:
"
TAG
"
# pullPolicy: IfNotPresent or Never or Always
pullPolicy
:
Always
...
...
charts/oai-smf/values.yaml
View file @
da00013b
...
...
@@ -9,7 +9,7 @@ namespace: "PROJECT"
image
:
registry
:
local
repository
:
image-registry.openshift-image-registry.svc:5000/PROJECT/oai-smf
version
:
TAG
version
:
"
TAG
"
#pullPolicy: IfNotPresent or Never or Always
pullPolicy
:
Always
...
...
charts/oai-spgwu-tiny/values.yaml
View file @
da00013b
...
...
@@ -9,7 +9,7 @@ namespace: "PROJECT"
image
:
registry
:
local
repository
:
image-registry.openshift-image-registry.svc:5000/PROJECT/oai-spgwu-tiny
version
:
TAG
version
:
"
TAG
"
# pullPolicy: IfNotPresent or Never or Always
pullPolicy
:
Always
...
...
ci-scripts/Jenkinsfile-GitLab-Helm
View file @
da00013b
...
...
@@ -204,11 +204,7 @@ pipeline {
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.OC_Credentials}"
,
usernameVariable:
'OC_Username'
,
passwordVariable:
'OC_Password'
]
])
{
dir
(
'ci-scripts'
)
{
try
{
sh
"python3 helmDeploy.py --mode=Deploy --remoteIPAdd=${params.remote_IPAddress} --remoteUserName=${remote_Username} --remotePassword=${remote_Password} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --imageTags=${imageTags}"
}
catch
(
Exception
e
)
{
currentBuild
.
result
=
'FAILURE'
}
sh
"python3 helmDeploy.py --mode=Deploy --remoteIPAdd=${params.remote_IPAddress} --remoteUserName=${remote_Username} --remotePassword=${remote_Password} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --imageTags=${imageTags}"
}
}
}
...
...
@@ -236,6 +232,13 @@ pipeline {
}
}
}
dir
(
'ci-scripts'
)
{
try
{
sh
"python3 helmDeploy.py --mode=GetLogs --remoteIPAdd=${params.remote_IPAddress} --remoteUserName=${remote_Username} --remotePassword=${remote_Password} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --imageTags=${imageTags}"
}
catch
(
Exception
e
)
{
echo
"Unable to get the 5gcn components pod logs"
}
}
}
}
}
...
...
ci-scripts/helmDeploy.py
View file @
da00013b
...
...
@@ -257,6 +257,34 @@ class ClusterDeploy:
mySSH
.
close
()
self
.
AnalyzeLogFile_5gcn
()
def
GetLogsConfigs
(
self
):
lIpAddr
=
self
.
remoteIPAdd
lUserName
=
self
.
remoteUserName
lPassWord
=
self
.
remotePassword
lSourcePath
=
self
.
sourceCodePath
mySSH
=
SSH
.
SSHConnection
()
mySSH
.
open
(
lIpAddr
,
lUserName
,
lPassWord
)
images
=
self
.
imageTags
.
split
(
','
)
for
image
in
images
:
eachImage
=
image
.
split
(
':'
)
imageName
=
eachImage
[
0
]
imageTag
=
eachImage
[
1
]
if
imageName
==
'mysql'
:
continue
if
imageName
==
'oai-nrf'
:
nameSufix
=
'nrf'
elif
imageName
==
'oai-amf'
:
nameSufix
=
'amf'
elif
imageName
==
'oai-smf'
:
nameSufix
=
'smf'
elif
imageName
==
'oai-spgwu-tiny'
:
nameSufix
=
'spgwu'
mySSH
.
command2
(
f
'oc get pods -o wide -l app.kubernetes.io/instance=
{
imageName
}
'
,
6
,
silent
=
True
)
result
=
re
.
search
(
f
'
{
imageName
}
[\S\d\w]+'
,
mySSH
.
cmd2Results
)
podName
=
result
.
group
(
0
)
mySSH
.
command2
(
f
'oc logs
{
podName
}
{
nameSufix
}
>
{
lSourcePath
}
/archives/
{
imageName
}
_pod.log'
,
10
,
silent
=
True
)
mySSH
.
command
(
'oc logout'
,
'\$'
,
6
)
mySSH
.
close
()
def
AnalyzeLogFile_5gcn
(
self
):
lIpAddr
=
self
.
remoteIPAdd
...
...
@@ -338,4 +366,6 @@ while len(argvs) > 1:
if
CN
.
mode
==
'Deploy'
:
CN
.
Deploy_5gcn
()
elif
CN
.
mode
==
'UnDeploy'
:
CN
.
UnDeploy_5gcn
()
\ No newline at end of file
CN
.
UnDeploy_5gcn
()
elif
CN
.
mode
==
'GetLogs'
:
CN
.
GetLogsConfigs
()
\ No newline at end of file
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