-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,27 @@ | ||
pipeline{ | ||
|
||
agent any | ||
|
||
stages { | ||
|
||
stage('Git Checkout'){ | ||
|
||
steps{ | ||
|
||
script{ | ||
|
||
git branch: 'main', url: 'https://github.com/saad946/Jenkins-SonarQube-FluxCD-CICD.git' | ||
} | ||
} | ||
} | ||
stage('UNIT testing'){ | ||
|
||
steps{ | ||
|
||
script{ | ||
|
||
sh 'mvn test' | ||
} | ||
} | ||
} | ||
stage('Integration testing'){ | ||
|
||
steps{ | ||
|
||
script{ | ||
|
||
sh 'mvn verify -DskipUnitTests' | ||
} | ||
} | ||
} | ||
stage('Maven build'){ | ||
|
||
steps{ | ||
|
||
script{ | ||
|
||
sh 'mvn clean install' | ||
|
||
stages{ | ||
|
||
stage('sonar quality check'){ | ||
|
||
agent{ | ||
|
||
docker { | ||
image 'maven' | ||
} | ||
} | ||
} | ||
stage('Static code analysis'){ | ||
|
||
steps{ | ||
|
||
script{ | ||
|
||
withSonarQubeEnv(credentialsId: 'sonar-api') { | ||
|
||
sh 'mvn clean package sonar:sonar' | ||
} | ||
} | ||
|
||
} | ||
} | ||
stage('Quality Gate Status'){ | ||
|
||
steps{ | ||
|
||
script{ | ||
|
||
waitForQualityGate abortPipeline: false, credentialsId: 'sonar-api' | ||
} | ||
|
||
withSonarQubeEnv(credentialsId: 'sonar-token') { | ||
|
||
sh 'mvn clean package sonar:sonar' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |