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 6d08676 commit 7bd636c
Showing 1 changed file with 17 additions and 63 deletions.
80 changes: 17 additions & 63 deletions Jenkinsfile
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'
}
}
}
}
}
}

0 comments on commit 7bd636c

Please sign in to comment.