Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas0105 committed Jan 2, 2025
1 parent fb22439 commit 74ffb0a
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ pipeline {
agent any

environment {
SONAR_TOKEN = credentials('sonar-token')
SONAR_ORG = 'vikas0105'
SONAR_HOST_URL = 'https://sonarcloud.io'
JAVA_HOME = '/usr/lib/jvm/java-17-openjdk-amd64'
}

Expand Down Expand Up @@ -37,13 +34,14 @@ pipeline {

stage('Build with Maven') {
steps {
// Use Maven without specifying the version from Jenkins' Global Tool Configuration
// Use Maven to build the project
sh 'mvn clean install -DskipTests'
}
}

stage('Run Spring Boot App') {
steps {
// Run the Spring Boot app in the background
sh 'mvn spring-boot:run &'
}
}
Expand Down Expand Up @@ -84,22 +82,6 @@ pipeline {
sh 'mvn spring-boot:stop'
}
}

stage('SonarCloud Analysis') {
steps {
script {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
sh """
mvn sonar:sonar \
-Dsonar.organization=${env.SONAR_ORG} \
-Dsonar.host.url=${env.SONAR_HOST_URL} \
-Dsonar.projectKey=vikas0105_Parcel-service \
-Dsonar.login=${env.SONAR_TOKEN}
"""
}
}
}
}
}

post {
Expand Down

0 comments on commit 74ffb0a

Please sign in to comment.