forked from bcgov/ols-geocoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
51 lines (42 loc) · 1.67 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
node ('master'){
def server = Artifactory.server "${artifactSvr}"
def rtMaven = Artifactory.newMavenBuild()
def buildInfo
stage ('SCM prepare'){
deleteDir()
checkout([$class: 'GitSCM',
branches: [[name: '${gitTag}']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'WipeWorkspace']],
gitTool: 'Default',
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://github.com/bcgov/ols-geocoder']]
])
withMaven(jdk: 'ojdk', maven: 'm3') {
sh 'mvn versions:set -DnewVersion="${mvnTag}"'
}
}
stage ('Artifactory configuration'){
rtMaven.tool = 'm3' // Tool name from Jenkins configuration
rtMaven.deployer releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', server: server
rtMaven.resolver releaseRepo: 'repo', snapshotRepo: 'repo', server: server
rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run
buildInfo = Artifactory.newBuildInfo()
}
stage ('Maven Install'){
env.JAVA_HOME = "${tool 'ojdk'}"
rtMaven.run pom: 'pom.xml', goals: 'clean install -Dmaven.test.skip=true', buildInfo: buildInfo
}
stage ('Artifactory Deploy'){
rtMaven.deployer.deployArtifacts buildInfo
}
stage ('Artifactory Publish build info'){
server.publishBuildInfo buildInfo
}
/* do not deploy
stage ('Deploy to Application Server') {
sh '''ssh app@${appServer} "rm -rf /apps/geocat/webapps/pub#geocoder*"
scp -r $WORKSPACE/ols-web/target/*.war app@${appServer}:/apps/geocat/webapps/pub#geocoder.war'''
}
*/
}