forked from greydonbuckley/CorpSite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.ci
51 lines (46 loc) · 1.59 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
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') {
environment {
TOMCAT = credentials('tomcat_user')
}
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'
sh 'curl -u $TOMCAT_USR:$TOMCAT_PSW --location --request PUT \'http://tomcat:8080/manager/text/deploy?path=/globex&war=globex-web.war&update=true\' --header \'Content-Type: application/java-archive\' --data-binary \'@target/globex-web.war\''
}
post {
success {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Publish') {
steps {
sh 'echo publish stage'
snDevOpsStep()
snDevOpsArtifact(artifactsPayload:"""{"artifacts": [{"name": "globex-web.war","version":"2.${env.BUILD_NUMBER}.0","semanticVersion": "2.${env.BUILD_NUMBER}.0","repositoryName": "Repo1"}]}""")
}
}
}
}