forked from charyveer75/simplewebapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
40 lines (29 loc) · 872 Bytes
/
Jenkinsfile
File metadata and controls
40 lines (29 loc) · 872 Bytes
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
node {
try {
stage('Code Checkout') {
// Get some code from a GitHub repository
git 'https://github.com/rchidana/simplewebapp.git'
}
stage('Unit Test') {
withEnv(['PATH+EXTRA=/opt/apache-maven-3.6.3/bin']) {
// Get some code from a GitHub repository
sh 'mvn clean compile'
sh 'mvn test'
}
}
stage('Test Results') {
junit '**/target/surefire-reports/TEST-*.xml'
archive 'target/*.jar'
}
stage('Package & Deploy') {
withEnv(['PATH+EXTRA=/opt/apache-maven-3.6.3/bin']) {
sh 'mvn package'
sh 'curl --upload-file target/simplewebapp.war "http://deployer:deployer@34.72.215.214:8081/manager/text/deploy?path=/byjenkins&update=true"'
}
}
} catch(e) {
echo "Caught some exception"
} finally {
echo "Finally Block"
}
}