Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
saad946 authored Oct 7, 2023
1 parent 74d0d9c commit ad401e5
Showing 1 changed file with 61 additions and 21 deletions.
82 changes: 61 additions & 21 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,73 @@
pipeline{

agent any

stages{

stage('sonar quality check'){

agent{

docker {
image 'maven'

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 'pwd'
sh 'ls -la' // List files in the current directory for debugging
sh 'echo $MAVEN_HOME' // Print Maven home for debugging

sh 'mvn clean package sonar:sonar -X'

sh 'mvn test'
}
}
}
stage('Integration testing'){

steps{

script{

sh 'mvn verify -DskipUnitTests'
}
}
}
stage('Maven build'){

steps{

script{

sh 'mvn clean install'
}
}
}
stage('Static code analysis'){

steps{

script{

withSonarQubeEnv(credentialsId: 'sonars-tokens') {

sh 'mvn clean package sonar:sonar'
}
}

}
}
stage('Quality Gate Status'){

steps{


script{

waitForQualityGate abortPipeline: false, credentialsId: 'sonars-tokens'
}
}
}
}
}
}

0 comments on commit ad401e5

Please sign in to comment.