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
2c97c95e
Commit
2c97c95e
authored
May 17, 2021
by
ismail
Browse files
CI: update on the cluster deployment CI
Signed-off-by:
ismail
<
mohammed.ismail@openairinterface.org
>
parent
153acc96
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
charts/mysql/templates/deployment.yaml
View file @
2c97c95e
...
...
@@ -6,7 +6,7 @@ metadata:
labels
:
app
:
{{
template "mysql.fullname" .
}}
chart
:
"
{{
.Chart.Name
}}-{{
.Chart.Version
}}"
releas
e
:
"
{{
.Release.Name
}}"
app.kubernetes.io/instanc
e
:
"
{{
.Release.Name
}}"
heritage
:
"
{{
.Release.Service
}}"
{{
- with .Values.deploymentAnnotations
}}
annotations
:
...
...
@@ -19,12 +19,12 @@ spec:
selector
:
matchLabels
:
app
:
{{
template "mysql.fullname" .
}}
releas
e
:
{{
.Release.Name
}}
app.kubernetes.io/instanc
e
:
{{
.Release.Name
}}
template
:
metadata
:
labels
:
app
:
{{
template "mysql.fullname" .
}}
releas
e
:
{{
.Release.Name
}}
app.kubernetes.io/instanc
e
:
{{
.Release.Name
}}
{{
- with .Values.podLabels
}}
{{
toYaml . | indent 8
}}
{{
- end
}}
...
...
charts/mysql/values.yaml
View file @
2c97c95e
# mysql image version
## ref: https://hub.docker.com/r/library/mysql/tags/
##
image
:
"
mysq
l"
imageTag
:
"
5.7.30
"
image
:
"
image-registry.openshift-image-registry.svc:5000/oaicicd-tmp/mysql-interna
l"
imageTag
:
"
TAG
"
strategy
:
type
:
Recreate
...
...
charts/oai-amf/values.yaml
View file @
2c97c95e
...
...
@@ -4,12 +4,12 @@
replicaCount
:
1
namespace
:
"
oaicicd-tmp
"
namespace
:
"
PROJECT
"
image
:
registry
:
local
repository
:
image-registry.openshift-image-registry.svc:5000/
oaicicd-tmp
/oai-amf
version
:
develop
repository
:
image-registry.openshift-image-registry.svc:5000/
PROJECT
/oai-amf
version
:
"
TAG"
# pullPolicy: IfNotPresent or Never or Always
pullPolicy
:
Always
...
...
charts/oai-nrf/values.yaml
View file @
2c97c95e
...
...
@@ -4,12 +4,12 @@
replicaCount
:
1
namespace
:
"
oaicicd-tmp
"
namespace
:
"
PROJECT
"
image
:
registry
:
local
repository
:
image-registry.openshift-image-registry.svc:5000/
oaicicd-tmp
/oai-nrf
version
:
develop
repository
:
image-registry.openshift-image-registry.svc:5000/
PROJECT
/oai-nrf
version
:
TAG
# pullPolicy: IfNotPresent or Never or Always
pullPolicy
:
Always
...
...
charts/oai-smf/values.yaml
View file @
2c97c95e
...
...
@@ -4,12 +4,12 @@
replicaCount
:
1
namespace
:
"
oaicicd-tmp
"
namespace
:
"
PROJECT
"
image
:
registry
:
local
repository
:
oai-smf
version
:
develop
repository
:
image-registry.openshift-image-registry.svc:5000/PROJECT/
oai-smf
version
:
TAG
#pullPolicy: IfNotPresent or Never or Always
pullPolicy
:
Always
...
...
charts/oai-spgwu-tiny/values.yaml
View file @
2c97c95e
...
...
@@ -4,12 +4,12 @@
replicaCount
:
1
namespace
:
"
oaicicd-tmp
"
namespace
:
"
PROJECT
"
image
:
registry
:
local
repository
:
image-registry.openshift-image-registry.svc:5000/
oaicicd-tmp
/oai-spgwu-tiny
version
:
develop
repository
:
image-registry.openshift-image-registry.svc:5000/
PROJECT
/oai-spgwu-tiny
version
:
TAG
# pullPolicy: IfNotPresent or Never or Always
pullPolicy
:
Always
...
...
ci-scripts/Jenkinsfile-GitLab-Helm
View file @
2c97c95e
...
...
@@ -35,6 +35,7 @@ def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) {
def
cn_ci_host
=
params
.
Host_CN_CI_Server
// for lock
def
cn_ci_resource
=
params
.
CN_CI_Resource
def
ds_tester_ci_resource
=
params
.
DsTester
// Location of the DsTester workspace
...
...
@@ -81,10 +82,12 @@ pipeline {
JOB_TIMESTAMP
=
JOB_TIMESTAMP
.
trim
()
def
allParametersPresent
=
true
if
(
params
.
eNB
_IPAddress
==
null
)
{
if
(
params
.
remote
_IPAddress
==
null
)
{
allParametersPresent
=
false
if
(
params
.
eNB_Credentials
==
null
)
{
}
if
(
params
.
remote_Credentials
==
null
)
{
allParametersPresent
=
false
}
if
(
params
.
OC_Credentials
==
null
)
{
allParametersPresent
=
false
}
...
...
@@ -100,7 +103,7 @@ pipeline {
if
(
params
.
DS_Tester_Server_Flag
!=
null
)
{
dsT_host_flag
=
params
.
DS_Tester_Server_Flag
if
(
dsT_host_flag
)
{
def
allParametersPresent
=
true
allParametersPresent
=
true
if
(
params
.
DS_Tester_Server_Name
==
null
)
{
allParametersPresent
=
false
}
else
{
...
...
@@ -134,7 +137,7 @@ pipeline {
}
}
withCredentials
([
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.
eNB
_Credentials}"
,
usernameVariable:
'
eNB
_Username'
,
passwordVariable:
'
eNB
_Password'
],
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.
remote
_Credentials}"
,
usernameVariable:
'
remote
_Username'
,
passwordVariable:
'
remote
_Password'
],
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.OC_Credentials}"
,
usernameVariable:
'OC_Username'
,
passwordVariable:
'OC_Password'
]
])
{
if
(
upstreamEvent
)
{
...
...
@@ -156,9 +159,9 @@ pipeline {
sh
"zip -r -qq oai-cn5g-fed.zip .git"
sh
"mkdir -p archives DS-TEST-RESULTS"
// Prepare the workspace in the remote server
copyTo2ndServer
(
'oai-cn5g-fed.zip'
,
true
,
$
{
eNB
_Username
},
$
{
params
.
eNB
_IPAddress
})
myShCmd
(
'git clean -x -d -f > /dev/null 2>&1'
,
true
,
$
{
eNB
_Username
},
$
{
params
.
eNB
_IPAddress
})
myShCmd
(
'mkdir -p archives DS-TEST-RESULTS'
,
true
,
$
{
eNB
_Username
},
$
{
params
.
eNB
_IPAddress
})
copyTo2ndServer
(
'oai-cn5g-fed.zip'
,
true
,
$
{
remote
_Username
},
$
{
params
.
remote
_IPAddress
})
myShCmd
(
'git clean -x -d -f > /dev/null 2>&1'
,
true
,
$
{
remote
_Username
},
$
{
params
.
remote
_IPAddress
})
myShCmd
(
'mkdir -p archives DS-TEST-RESULTS'
,
true
,
$
{
remote
_Username
},
$
{
params
.
remote
_IPAddress
})
}
if
(
scmEvent
)
{
sh
"git clean -x -d -f > /dev/null 2>&1"
...
...
@@ -168,23 +171,23 @@ pipeline {
sh
"zip -r -qq oai-cn5g-fed.zip .git"
sh
"mkdir -p archives DS-TEST-RESULTS"
// Prepare the workspace in remote server
copyTo2ndServer
(
'oai-cn5g-fed.zip'
,
true
,
$
{
eNB
_Username
},
$
{
params
.
eNB
_IPAddress
})
myShCmd
(
'git clean -x -d -f > /dev/null 2>&1'
,
true
,
$
{
eNB
_Username
},
$
{
params
.
eNB
_IPAddress
})
copyTo2ndServer
(
'oai-cn5g-fed.zip'
,
true
,
$
{
remote
_Username
},
$
{
params
.
remote
_IPAddress
})
myShCmd
(
'git clean -x -d -f > /dev/null 2>&1'
,
true
,
$
{
remote
_Username
},
$
{
params
.
remote
_IPAddress
})
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
myShCmd
(
"./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
,
new_host_flag
,
new_host_user
,
new_host
)
}
myShCmd
(
'mkdir -p archives DS-TEST-RESULTS'
,
true
,
$
{
eNB
_Username
},
$
{
params
.
eNB
_IPAddress
})
myShCmd
(
'mkdir -p archives DS-TEST-RESULTS'
,
true
,
$
{
remote
_Username
},
$
{
params
.
remote
_IPAddress
})
}
if
((!
upstreamEvent
)
&&
(!
scmEvent
))
{
sh
"git clean -x -d -f > /dev/null 2>&1"
sh
"zip -r -qq oai-cn5g-fed.zip .git"
sh
"mkdir -p archives DS-TEST-RESULTS"
// Prepare the workspace in the remote server
copyTo2ndServer
(
'oai-cn5g-fed.zip'
,
true
,
$
{
eNB
_Username
}
,
$
{
params
.
eNB
_IPAddress
}
)
myShCmd
(
'git clean -x -d -f > /dev/null 2>&1'
,
true
,
$
{
eNB
_Username
}
,
$
{
params
.
eNB
_IPAddress
}
)
myShCmd
(
'mkdir -p archives DS-TEST-RESULTS'
,
true
,
$
{
eNB
_Username
}
,
$
{
params
.
eNB
_IPAddress
}
)
copyTo2ndServer
(
'oai-cn5g-fed.zip'
,
true
,
remote
_Username
,
params
.
remote
_IPAddress
)
myShCmd
(
'git clean -x -d -f > /dev/null 2>&1'
,
true
,
remote
_Username
,
params
.
remote
_IPAddress
)
myShCmd
(
'mkdir -p archives DS-TEST-RESULTS'
,
true
,
remote
_Username
,
params
.
remote
_IPAddress
)
}
imageTags
=
"oai-nrf:${nrfTag},oai-amf:${amfTag},oai-smf:${smfTag},oai-spgwu-tiny:${spgwuTag}"
imageTags
=
"
mysql:5.7.30,
oai-nrf:${nrfTag},oai-amf:${amfTag},oai-smf:${smfTag},oai-spgwu-tiny:${spgwuTag}"
}
}
}
...
...
@@ -194,13 +197,15 @@ pipeline {
script
{
echo
'\u2705 \u001B[32mDeploy CN5G in idle mode\u001B[0m'
withCredentials
([
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.
eNB
_Credentials}"
,
usernameVariable:
'
eNB
_Username'
,
passwordVariable:
'
eNB
_Password'
],
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.
remote
_Credentials}"
,
usernameVariable:
'
remote
_Username'
,
passwordVariable:
'
remote
_Password'
],
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.OC_Credentials}"
,
usernameVariable:
'OC_Username'
,
passwordVariable:
'OC_Password'
]
])
{
try
{
sh
"python3 helmDeploy.py --mode=Deploy --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --imageTags=${imageTags}"
}
catch
(
Exception
e
)
{
currentBuild
.
result
=
'FAILURE'
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'
}
}
}
}
...
...
@@ -210,13 +215,15 @@ pipeline {
steps
{
script
{
withCredentials
([
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.
eNB
_Credentials}"
,
usernameVariable:
'
eNB
_Username'
,
passwordVariable:
'
eNB
_Password'
],
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.
remote
_Credentials}"
,
usernameVariable:
'
remote
_Username'
,
passwordVariable:
'
remote
_Password'
],
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.OC_Credentials}"
,
usernameVariable:
'OC_Username'
,
passwordVariable:
'OC_Password'
]
])
{
try
{
sh
"python3 helmDeploy.py --mode=UnDeploy --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --imageTags=${imageTags}"
}
catch
(
Exception
e
)
{
currentBuild
.
result
=
'FAILURE'
dir
(
'ci-scripts'
)
{
try
{
sh
"python3 helmDeploy.py --mode=UnDeploy --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'
}
}
}
}
...
...
ci-scripts/helmDeploy.py
View file @
2c97c95e
This diff is collapsed.
Click to expand it.
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