-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
65 lines (62 loc) · 2.15 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
pipeline {
agent any
stages {
stage ('Build Discovery') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: 'feature/refactoring_service_rent']],
userRemoteConfigs: [[
credentialsId: 'github_login',
url: 'https://github.com/imovato/backend/'
]]])
dir('discovery') {
bat 'mvn clean package -DskipTests=true'
}
}
}
stage ('Deploy Discovery') {
steps {
dir('discovery') {
deploy adapters: [tomcat8(credentialsId: 'TomcatLogin', path: '', url: 'http://localhost:8001/')], contextPath: 'discovery', war: 'target/discovery-0.0.1-SNAPSHOT.war'
}
}
}
stage ('Build Rent') {
steps {
dir('rent') {
bat 'mvn clean package -DskipTests=true'
}
}
}
stage ('Unit Tests-Rent') {
steps {
dir('rent'){
bat 'mvn test'
}
}
}
stage ('Sonar Analysis') {
environment {
scannerHome = tool 'SONAR_SCANNER'
}
steps {
withSonarQubeEnv('SONAR_LOCAL') {
bat "${scannerHome}/bin/sonar-scanner -e -Dsonar.projectKey=Imovato -Dsonar.host.url=http://localhost:9000 -Dsonar.login=fafc5fd8cda17cd9cf6e2e31bf248d294b8d0568 -Dsonar.java.binaries=target -Dsonar.coverage.exclusions=**/.mvn/**,**/src/test/**,**/model/**,**Application.java"
}
}
}
stage ('Deploy Rent') {
steps {
deploy adapters: [tomcat8(credentialsId: 'TomcatLogin', path: '', url: 'http://localhost:8001/')], contextPath: 'rentService', war: 'target/rent-0.0.1-SNAPSHOT.war'
}
}
stage ('API Test-Rent') {
steps {
dir('tests-api') {
bat 'mvn test'
}
}
}
}
}