forked from Hari25cs/SaiJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
36 lines (34 loc) · 1023 Bytes
/
Jenkinsfile
File metadata and controls
36 lines (34 loc) · 1023 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
pipeline {
// agent { node "Slave1" } or agent any
agent any
environment {
// Install the Maven version configured as "maven3.8" and add it to the path.
// tools { maven "maven3"}
// another way of using maven given below.
PATH="/opt/maven3/bin:$PATH"
}
stages {
stage('CheckOut') {
steps {
// Get some code from a GitHub repository
git credentialsId: '70860dd4-6c55-45b4-a377-6107adaa15a7', url: '[email protected]:paramv10/SaiJavaCode.git'
}
}
stage('Build') {
steps {
// Run Maven on a Unix agent.
sh "mvn -Dmaven.test.failure.ignore=true clean package"
// To run Maven on a Windows agent, use
// bat "mvn -Dmaven.test.failure.ignore=true clean package"
}
post {
// If Maven was able to run the tests, even if some of the test
// failed, record the test results and archive the war file.
success {
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'webapp/target/*.war'
}
}
}
}
}