-
Notifications
You must be signed in to change notification settings - Fork 673
/
Jenkinsfile.ci
62 lines (57 loc) · 1.89 KB
/
Jenkinsfile.ci
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
pipeline {
agent any
tools {
maven 'Jenkins Maven'
}
stages {
stage('Build') {
steps {
snDevOpsStep()
sh '''
export M2_HOME=/opt/apache-maven-3.6.0 # your Mavan home path
export PATH=$PATH:$M2_HOME/bin
mvn --version
'''
sh 'mvn compile'
}
}
stage('Test') {
steps {
snDevOpsStep()
sh '''
export M2_HOME=/opt/apache-maven-3.6.0 # your Mavan home path
export PATH=$PATH:$M2_HOME/bin
mvn --version
'''
sh 'mvn verify'
script {
sshPublisher(continueOnError: false, failOnError: true,
publishers: [
sshPublisherDesc(
configName:'CorpSite UAT',
verbose: true,
transfers: [
sshTransfer(
sourceFiles: 'target/globex-web.war',
removePrefix: 'target/',
remoteDirectory: '/opt/tomcat/webapps'
)
]
)
])
}
}
post {
success {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Publish') {
steps {
snDevOpsStep()
snDevOpsArtifact(artifactsPayload:"""{"artifacts": [{"name": "globex-web.war","version":"2.${env.BUILD_NUMBER}.0","semanticVersion": "2.${env.BUILD_NUMBER}.0","repositoryName": "Repo1"}]}""")
}
}
}
}