forked from shashirajraja/onlinebookstore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
26 lines (24 loc) · 860 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages {
stage('Build') {
steps {
echo "build app"
sh 'mvn clean package'
echo "Build is successful for ${env.BUILD_ID}"
}
}
stage('Static Code Analysis') {
environment {
SONAR_URL = "http://172.18.0.4:9000"
}
steps {
withCredentials([string(credentialsId: 'sonarqube', variable: 'SONAR_AUTH_TOKEN')]) {
sh 'cd java-maven-sonar-argocd-helm-k8s/spring-boot-app && mvn sonar:sonar -Dsonar.login=$SONAR_AUTH_TOKEN -Dsonar.host.url=${SONAR_URL}'
}
}
}
}