Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDR
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
0
Merge Requests
0
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-UDR
Commits
d66c73e4
Commit
d66c73e4
authored
Aug 11, 2021
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ci): add trigger to FED pipeline
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
5ad768b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
11 deletions
+49
-11
ci-scripts/Jenkinsfile-GitLab-Docker
ci-scripts/Jenkinsfile-GitLab-Docker
+46
-7
ci-scripts/generateHtmlReport.py
ci-scripts/generateHtmlReport.py
+3
-4
No files found.
ci-scripts/Jenkinsfile-GitLab-Docker
View file @
d66c73e4
...
...
@@ -66,8 +66,8 @@ pipeline {
"Build U18 UDR Image"
,
"Build RHEL8 UDR Image"
,
"Static Code Analysis"
,
"Code Formatting Checker"
//
,
//"Test with DsTester
"
"Code Formatting Checker"
,
"Test with DsTester on Docker environment
"
])
}
...
...
@@ -121,16 +121,14 @@ pipeline {
script
{
sh
"git clean -x -d -f > /dev/null 2>&1"
if
(
"MERGE"
.
equals
(
env
.
gitlabActionType
))
{
// Need a public repo
//gitlabMergeRequestLink = sh "curl --silent \"https://gitlab.eurecom.fr/api/v4/projects/oai%2Fcn5g%2Foai-cn5g-udr/merge_requests/${env.gitlabMergeRequestIid}\" | jq .web_url | sed 's#\"##g'"
gitlabMergeRequestLink
=
sh
returnStdout:
true
,
script:
"curl --silent 'https://gitlab.eurecom.fr/api/v4/projects/oai%2Fcn5g%2Foai-cn5g-udr/merge_requests/${env.gitlabMergeRequestIid}' | jq .web_url | sed 's#\"##g'"
gitlabMergeRequestLink
=
gitlabMergeRequestLink
.
trim
()
echo
"========= THIS IS A MERGE REQUEST =========="
echo
"MR ID is ${env.gitlabMergeRequestIid}"
//echo "MR LINK is ${gitlabMergeRequestLink}"
echo
"MR TITLE is ${env.gitlabMergeRequestTitle}"
gitCommitAuthorEmailAddr
=
env
.
gitlabUserEmail
echo
"GitLab Usermail is ${gitCommitAuthorEmailAddr}"
// Need a public repo
//sh "git fetch --prune --unshallow"
shortenShaOne
=
sh
returnStdout:
true
,
script:
'git log -1 --pretty=format:"%h" '
+
env
.
gitlabMergeRequestLastCommit
shortenShaOne
=
shortenShaOne
.
trim
()
sh
"./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
...
...
@@ -341,6 +339,40 @@ pipeline {
}
}
}
stage
(
'Testing whole 5g Core Network Functions'
)
{
parallel
{
stage
(
'Testing in CN-5G-FED Docker environment'
)
{
steps
{
script
{
gitlabCommitStatus
(
name:
"Test with DsTester on Docker environment"
)
{
localStatus
=
build
job:
params
.
CN5G_FED_PipelineName
,
parameters:
[
string
(
name:
'UDR_TAG'
,
value:
String
.
valueOf
(
udr_tag
)),
string
(
name:
'UDR_BRANCH'
,
value:
String
.
valueOf
(
udr_branch
))
],
propagate:
false
localResult
=
localStatus
.
getResult
()
if
(
localStatus
.
resultIsBetterOrEqualTo
(
'SUCCESS'
))
{
echo
"Docker Federation Test Job is OK"
}
else
{
echo
"Docker Federation Test Job is KO"
sh
"ci-scripts/fail.sh"
}
}
}
}
post
{
always
{
script
{
copyArtifacts
(
projectName:
params
.
CN5G_FED_PipelineName
,
filter:
'*_results_oai_cn5g.html'
,
selector:
lastCompleted
())
}
}
}
}
}
}
}
post
{
success
{
...
...
@@ -408,14 +440,21 @@ pipeline {
sh
"sed -i -e 's#TEMPLATE_MERGE_REQUEST_LINK#${gitlabMergeRequestLink}#g' test_results_oai_udr.html"
sh
"sed -i -e 's#TEMPLATE_MERGE_REQUEST_TEMPLATE#${env.gitlabMergeRequestTitle}#' test_results_oai_udr.html"
}
if
(
fileExists
(
'test_results_oai_cn5g.html'
))
{
sh
"sed -i -e 's#TEMPLATE_MERGE_REQUEST_LINK#${gitlabMergeRequestLink}#g' *_results_oai_cn5g.html"
sh
"sed -i -e 's#TEMPLATE_MERGE_REQUEST_TEMPLATE#${env.gitlabMergeRequestTitle}#' *_results_oai_cn5g.html"
}
}
else
{
sh
"python3 ci-scripts/generateHtmlReport.py --job_name=${JOB_NAME} --job_id=${BUILD_ID} --job_url=${BUILD_URL} --git_url=${GIT_URL} --git_src_branch=${GIT_BRANCH} --git_src_commit=${GIT_COMMIT}"
}
sh
"sed -i -e 's#TEMPLATE_TIME#${JOB_TIMESTAMP}#' test_results_oai_udr.html"
if
(
fileExists
(
'test_results_oai_udr.html'
))
{
sh
"sed -i -e 's#TEMPLATE_TIME#${JOB_TIMESTAMP}#' test_results_oai_udr.html"
archiveArtifacts
artifacts:
'test_results_oai_udr.html'
}
if
(
fileExists
(
'test_results_oai_cn5g.html'
))
{
sh
"sed -i -e 's#TEMPLATE_TIME#${JOB_TIMESTAMP}#' *_results_oai_cn5g.html"
archiveArtifacts
artifacts:
'*_results_oai_cn5g.html'
}
// Sending email to commiter
if
(
params
.
sendToCommitterEmail
!=
null
)
{
...
...
ci-scripts/generateHtmlReport.py
View file @
d66c73e4
...
...
@@ -60,9 +60,6 @@ class HtmlReport():
self
.
imageSizeRow
()
self
.
buildSummaryFooter
()
self
.
testSummaryHeader
()
self
.
testSummaryFooter
()
self
.
generateFooter
()
self
.
file
.
close
()
...
...
@@ -161,7 +158,9 @@ class HtmlReport():
self
.
file
.
write
(
buildSummary
)
cwd
=
os
.
getcwd
()
for
reportFile
in
glob
.
glob
(
'./*results_oai_cn5g.html'
):
for
reportFile
in
glob
.
glob
(
'./*results_oai_*.html'
):
if
reportFile
==
'./test_results_oai_udr.html'
:
continue
newEpcReport
=
open
(
cwd
+
'/'
+
str
(
reportFile
)
+
'.new'
,
'w'
)
buildSummaryDone
=
True
with
open
(
cwd
+
'/'
+
str
(
reportFile
),
'r'
)
as
originalEpcReport
:
...
...
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