forked from GHCdemo/microservices-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
51 lines (45 loc) · 1.42 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
pipeline {
agent any
tools {
jdk 'jdk8'
}
environment{
server = null
rtMaven = null
buildInfo = null
}
stages {
stage ('Initialize') {
steps {
script{
server = Artifactory.newServer url: 'http://localhost:8081/artifactory', username: 'admin', password: 'admin'
rtMaven = Artifactory.newMavenBuild()
rtMaven.resolver server: server, releaseRepo: 'all-repo', snapshotRepo: 'all-repo'
rtMaven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local'
rtMaven.deployer.deployArtifacts = false
rtMaven.tool = 'maven-3.5.4'
}
}
}
stage ('Build') {
steps {
script{
buildInfo = rtMaven.run pom: 'pom.xml', goals: 'clean install'
}
}
post {
success {
junit 'target/surefire-reports/**/*.xml'
}
}
}
stage('Publish'){
steps{
script{
rtMaven.deployer.deployArtifacts buildInfo
server.publishBuildInfo buildInfo
}
}
}
}
}