Skip to content

Commit e98f444

Browse files
committed
correçao
1 parent 9dc713b commit e98f444

File tree

1 file changed

+30
-42
lines changed

1 file changed

+30
-42
lines changed

Jenkinsfile

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,40 @@
1-
pipeline{
1+
pipeline {
22
agent any
33
tools{
44
maven 'maven'
55
}
6-
stages{
7-
stage('Build'){
8-
steps{
9-
sh '''
10-
mvn clean package -DskipTests
11-
'''
12-
}
6+
stages{
7+
stage('Build'){
8+
steps{
9+
sh '''
10+
mvn clean package -DskipTests
11+
'''
12+
}
13+
}
14+
stage('Test'){
15+
steps{
16+
sh 'mvn test'
1317
}
14-
stage('Test'){
15-
steps{
16-
sh 'mvn test'
17-
}
18+
}
19+
stage('Sonar'){
20+
environment{
21+
scanner = tool 'SONAR_SCANER'
1822
}
19-
stage('Sonar'){
20-
environment{
21-
scanner = tool 'SONAR_SCANER'
23+
steps{
24+
withSonarQubeEnv('SONAR'){
25+
sh "${scanner}/bin/sonar-scanner -e -Dsonar.host.url=http://172.17.0.1:9000 -Dsonar.projectKey=Backend -Dsonar.java.binaries=target -Dsonar.exclusions=src/test/**"
2226
}
23-
steps{
24-
withSonarQubeEnv('SONAR'){
25-
sh "${scanner}/bin/sonar-scanner -e -Dsonar.host.url=http://172.17.0.1:9000 -Dsonar.projectKey=Backend -Dsonar.java.binaries=target -Dsonar.exclusions=src/test/**"
26-
}
27-
}
28-
29-
}
30-
pipeline{
31-
agent any
32-
Stages{
33-
Stage('Stage 1'){
34-
steps{
35-
echo
36-
}
37-
}
3827
}
39-
}
40-
stage('QualityGate'){
41-
steps {
42-
sleep(10)
43-
timeout(1){
44-
withForQualityGate abortPipeline:false, credentialsId: 'token_sonar'
45-
}
46-
}
47-
}
48-
4928

50-
51-
}
29+
}
30+
stage('QualityGate'){
31+
steps {
32+
sleep(10)
33+
timeout(1){
34+
withForQualityGate abortPipeline:false, credentialsId: 'token_sonar'
35+
}
36+
}
37+
}
38+
5239
}
40+
}

0 commit comments

Comments
 (0)