-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
35 lines (31 loc) · 1.14 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
node{
def server = Artifactory.server 'ART'
def rtMaven = Artifactory.newMavenBuild()
def mvnHome = tool name: 'M2_HOME', type: 'maven'
def buildInfo
def branch = 'master'
def gitCredentialsId = env.GIT_CREDENTIALS
def gitUrl =env.GIT_URL
stage('checkout'){
git branch: branch, credentialsId: gitCredentialsId, url: gitUrl
}
stage('--------- Artifactory configuration ----------------') {
/*
JFrog artifactory configuration
*/
rtMaven.tool = 'M2_HOME' // Tool name from Jenkins configuration
rtMaven.deployer releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', server: server
rtMaven.resolver releaseRepo: 'libs-release', snapshotRepo: 'libs-snapshot', server: server
buildInfo = Artifactory.newBuildInfo()
buildInfo.env.capture = true
}
stage('---------- mvn-clean-install and push to artifactory ---------------') {
rtMaven.run pom: 'pom.xml', goals: 'clean install -DskipTests -Dspring.cloud.config.label='+branch, buildInfo: buildInfo
}
stage('----------- Publish build info -------------') {
/*
Publishing build info to Artifcatory (JFrog)
*/
server.publishBuildInfo buildInfo
}
}