forked from jyotheesh/Inglibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
31 lines (29 loc) · 982 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
27
28
29
30
31
node('master'){
post {
always {
cleanWs()
}
}
stage('git checkout'){
git 'https://github.com/vmkk24/Inglibrary.git'
}
stage('java build'){
sh '/opt/maven/bin/mvn clean verify sonar:sonar -Dsonar.password=admin -Dsonar.login=admin'
}
stage("build & SonarQube analysis") {
withSonarQubeEnv('sonar') {
sh '/opt/maven/bin/mvn clean deploy sonar:sonar'
}
}
stage("Quality Gate"){
timeout(time: 60, unit: 'SECONDS') {
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
stage('Running java backend application'){
sh 'export JENKINS_NODE_COOKIE=dontKillMe ;nohup java -Dspring.profiles.active=sit -jar $WORKSPACE/target/*.jar &'
}
}