diff --git a/Jenkinsfile b/Jenkinsfile index c978297..171e3d4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,25 +1,22 @@ -pipeline { - agent any - stages { - stage('Checkout') { - steps { - echo 'Checkout completed' - } - } - stage('Static-test') { - steps { - echo 'Running static tests on code' - } - } - stage('Build') { - steps { - sh 'echo "Building the code"' - } - } - stage('Deploy') { - steps { - echo 'Deploying into environment' - } - } - } +pipeline{ + agent {label 'angular'} + stages{ + stage('Git Checkout Stage'){ + steps{ + git branch: 'main', url: 'https://github.com/sudheer76R/java-example.git' + } + } + stage('Build Stage'){ + steps{ + sh 'mvn clean install' + } + } + stage('SonarQube Analysis Stage') { + steps{ + withSonarQubeEnv('sonarqube-server') { + sh "mvn clean verify sonar:sonar" + } + } + } + } }