forked from mythribhay/Inglibrary
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathJenkinsfile
More file actions
27 lines (24 loc) · 922 Bytes
/
Copy pathJenkinsfile
File metadata and controls
27 lines (24 loc) · 922 Bytes
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
node('master'){
stage('git checkout'){
git 'https://github.com/jyotheesh/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 &'
}
}