Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
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 UE
Commits
06a58d80
Commit
06a58d80
authored
Apr 07, 2021
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CI] triggering child pipeline
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
21c28f4c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
49 deletions
+68
-49
ci-scripts/Jenkinsfile-GitLab-Container
ci-scripts/Jenkinsfile-GitLab-Container
+19
-0
ci-scripts/cls_static_code_analysis.py
ci-scripts/cls_static_code_analysis.py
+49
-49
No files found.
ci-scripts/Jenkinsfile-GitLab-Container
View file @
06a58d80
...
@@ -152,6 +152,25 @@ pipeline {
...
@@ -152,6 +152,25 @@ pipeline {
}
}
}
}
}
}
stage
(
"CppCheck Analysis"
)
{
steps
{
script
{
triggerSlaveJob
(
'RAN-cppcheck'
,
'CppCheck Analysis'
)
}
}
post
{
always
{
script
{
finalizeSlaveJob
(
'RAN-cppcheck'
)
}
}
failure
{
script
{
currentBuild
.
result
=
'FAILURE'
}
}
}
}
}
}
}
}
}
}
...
...
ci-scripts/cls_static_code_analysis.py
View file @
06a58d80
...
@@ -81,55 +81,55 @@ class StaticCodeAnalysis():
...
@@ -81,55 +81,55 @@ class StaticCodeAnalysis():
self
.
eNBSourceCodePath
=
''
self
.
eNBSourceCodePath
=
''
def
CppCheckAnalysis
(
self
,
HTML
):
def
CppCheckAnalysis
(
self
,
HTML
):
#
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
if
self
.
ranRepository
==
''
or
self
.
ranBranch
==
''
or
self
.
ranCommitID
==
''
:
#
HELP.GenericHelp(CONST.Version)
HELP
.
GenericHelp
(
CONST
.
Version
)
#
sys.exit('Insufficient Parameter')
sys
.
exit
(
'Insufficient Parameter'
)
#
lIpAddr = self.eNBIPAddress
lIpAddr
=
self
.
eNBIPAddress
#
lUserName = self.eNBUserName
lUserName
=
self
.
eNBUserName
#
lPassWord = self.eNBPassword
lPassWord
=
self
.
eNBPassword
#
lSourcePath = self.eNBSourceCodePath
lSourcePath
=
self
.
eNBSourceCodePath
#
#
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
if
lIpAddr
==
''
or
lUserName
==
''
or
lPassWord
==
''
or
lSourcePath
==
''
:
#
HELP.GenericHelp(CONST.Version)
HELP
.
GenericHelp
(
CONST
.
Version
)
#
sys.exit('Insufficient Parameter')
sys
.
exit
(
'Insufficient Parameter'
)
#
logging.debug('Building on server: ' + lIpAddr)
logging
.
debug
(
'Building on server: '
+
lIpAddr
)
#
mySSH = SSH.SSHConnection()
mySSH
=
SSH
.
SSHConnection
()
#
mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH
.
open
(
lIpAddr
,
lUserName
,
lPassWord
)
#
#
self.testCase_id = HTML.testCase_id
self
.
testCase_id
=
HTML
.
testCase_id
#
#
# on RedHat/CentOS .git extension is mandatory
# on RedHat/CentOS .git extension is mandatory
#
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
result
=
re
.
search
(
'([a-zA-Z0-9\:\-\.\/])+\.git'
,
self
.
ranRepository
)
#
if result is not None:
if
result
is
not
None
:
#
full_ran_repo_name = self.ranRepository
full_ran_repo_name
=
self
.
ranRepository
#
else:
else
:
#
full_ran_repo_name = self.ranRepository + '.git'
full_ran_repo_name
=
self
.
ranRepository
+
'.git'
#
mySSH.command('mkdir -p ' + lSourcePath, '\$', 5)
mySSH
.
command
(
'mkdir -p '
+
lSourcePath
,
'\$'
,
5
)
#
mySSH.command('cd ' + lSourcePath, '\$', 5)
mySSH
.
command
(
'cd '
+
lSourcePath
,
'\$'
,
5
)
#
mySSH.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + full_ran_repo_name + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600)
mySSH
.
command
(
'if [ ! -e .git ]; then stdbuf -o0 git clone '
+
full_ran_repo_name
+
' .; else stdbuf -o0 git fetch --prune; fi'
,
'\$'
,
600
)
#
# Raphael: here add a check if git clone or git fetch went smoothly
# Raphael: here add a check if git clone or git fetch went smoothly
#
mySSH.command('git config user.email "jenkins@openairinterface.org"', '\$', 5)
mySSH
.
command
(
'git config user.email "jenkins@openairinterface.org"'
,
'\$'
,
5
)
#
mySSH.command('git config user.name "OAI Jenkins"', '\$', 5)
mySSH
.
command
(
'git config user.name "OAI Jenkins"'
,
'\$'
,
5
)
#
#
mySSH.command('echo ' + lPassWord + ' | sudo -S git clean -x -d -ff', '\$', 30)
mySSH
.
command
(
'echo '
+
lPassWord
+
' | sudo -S git clean -x -d -ff'
,
'\$'
,
30
)
#
mySSH.command('mkdir -p cmake_targets/log', '\$', 5)
mySSH
.
command
(
'mkdir -p cmake_targets/log'
,
'\$'
,
5
)
#
# if the commit ID is provided use it to point to it
# if the commit ID is provided use it to point to it
#
if self.ranCommitID != '':
if
self
.
ranCommitID
!=
''
:
#
mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 5)
mySSH
.
command
(
'git checkout -f '
+
self
.
ranCommitID
,
'\$'
,
5
)
#
#
mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 60)
mySSH
.
command
(
'docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true'
,
'\$'
,
60
)
#
mySSH.command('docker build --tag oai-cppcheck:xenial --file ci-scripts/docker/Dockerfile.cppcheck.xenial . > cmake_targets/log/cppcheck-xenial.txt 2>&1', '\$', 600)
mySSH
.
command
(
'docker build --tag oai-cppcheck:xenial --file ci-scripts/docker/Dockerfile.cppcheck.xenial . > cmake_targets/log/cppcheck-xenial.txt 2>&1'
,
'\$'
,
600
)
#
mySSH.command('sed -e "s@xenial@bionic@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.bionic', '\$', 6)
mySSH
.
command
(
'sed -e "s@xenial@bionic@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.bionic'
,
'\$'
,
6
)
#
mySSH.command('docker build --tag oai-cppcheck:bionic --file ci-scripts/docker/Dockerfile.cppcheck.bionic . > cmake_targets/log/cppcheck-bionic.txt 2>&1', '\$', 600)
mySSH
.
command
(
'docker build --tag oai-cppcheck:bionic --file ci-scripts/docker/Dockerfile.cppcheck.bionic . > cmake_targets/log/cppcheck-bionic.txt 2>&1'
,
'\$'
,
600
)
#
mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 60)
mySSH
.
command
(
'docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true'
,
'\$'
,
60
)
#
#
# Analyzing the logs
# Analyzing the logs
#
mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5)
mySSH
.
command
(
'cd '
+
lSourcePath
+
'/cmake_targets'
,
'\$'
,
5
)
#
mySSH.command('mkdir -p build_log_' + self.testCase_id, '\$', 5)
mySSH
.
command
(
'mkdir -p build_log_'
+
self
.
testCase_id
,
'\$'
,
5
)
#
mySSH.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5)
mySSH
.
command
(
'mv log/* '
+
'build_log_'
+
self
.
testCase_id
,
'\$'
,
5
)
#
mySSH.close()
mySSH
.
close
()
#
#
mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/build_log_' + self.testCase_id + '/*', '.')
mySSH
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
lSourcePath
+
'/cmake_targets/build_log_'
+
self
.
testCase_id
+
'/*'
,
'.'
)
CCR
=
CppCheckResults
()
CCR
=
CppCheckResults
()
vId
=
0
vId
=
0
for
variant
in
CCR
.
variants
:
for
variant
in
CCR
.
variants
:
...
...
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