Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
centreon
centreon-widget-global-health
Commits
8f566ed0
Unverified
Commit
8f566ed0
authored
Mar 19, 2021
by
sc979
Committed by
GitHub
Mar 19, 2021
Browse files
enh(chore): integrate sonarQube dev edition (#31)
parent
2d56df1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Jenkinsfile
View file @
8f566ed0
...
...
@@ -4,6 +4,7 @@
properties
([
buildDiscarder
(
logRotator
(
numToKeepStr:
'50'
))])
def
serie
=
'21.04'
def
maintenanceBranch
=
"${serie}.x"
if
(
env
.
BRANCH_NAME
.
startsWith
(
'release-'
))
{
env
.
BUILD
=
'RELEASE'
}
else
if
((
env
.
BRANCH_NAME
==
'master'
)
||
(
env
.
BRANCH_NAME
==
maintenanceBranch
))
{
...
...
@@ -76,10 +77,9 @@ try {
trendChartType:
'NONE'
)
if
((
env
.
BUILD
==
'RELEASE'
)
||
(
env
.
BUILD
==
'REFERENCE'
))
{
withSonarQubeEnv
(
'SonarQube'
)
{
sh
"./centreon-build/jobs/widgets/${serie}/widget-analysis.sh"
}
// Run sonarQube analysis
withSonarQubeEnv
(
'SonarQubeDev'
)
{
sh
"./centreon-build/jobs/widgets/${serie}/widget-analysis.sh"
}
}
}
...
...
@@ -88,6 +88,19 @@ try {
}
}
// sonarQube step to get qualityGate result
stage
(
'Quality gate'
)
{
timeout
(
time:
10
,
unit:
'MINUTES'
)
{
def
qualityGate
=
waitForQualityGate
()
if
(
qualityGate
.
status
!=
'OK'
)
{
currentBuild
.
result
=
'FAIL'
}
}
if
((
currentBuild
.
result
?:
'SUCCESS'
)
!=
'SUCCESS'
)
{
error
(
'Quality gate failure: ${qualityGate.status}.'
);
}
}
stage
(
'Package'
)
{
parallel
'centos7'
:
{
node
{
...
...
sonar-project.properties
View file @
8f566ed0
sonar.projectKey
=
centreon-widget-global-health-21.04
sonar.projectName
=
Centreon Widget Global Health 21.04
# project
sonar.projectKey
=
{PROJECT_TITLE}
sonar.projectName
=
{PROJECT_NAME}
sonar.projectVersion
=
{PROJECT_VERSION}
sonar.sources
=
./global-health
Write
Preview
Supports
Markdown
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