Skip to content

Commit 45ea81f

Browse files
authored
added Jenkinsfile
added Jenkinsfile
1 parent b695f19 commit 45ea81f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Jenkinsfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
pipeline {
2+
// agent { node "Slave1" } or agent any
3+
agent any
4+
environment {
5+
// Install the Maven version configured as "maven3.8" and add it to the path.
6+
// tool { maven "maven3"
7+
// another way of using maven given below.
8+
9+
PATH="/opt/maven3/bin:$PATH"
10+
}
11+
12+
stages {
13+
stage('CheckOut') {
14+
steps {
15+
// Get some code from a GitHub repository
16+
git branch: 'dev', credentialsId: '70860dd4-6c55-45b4-a377-6107adaa15a7', url: 'git@github.com:paramv10/taxi-booking.git'
17+
}
18+
}
19+
stage('Build') {
20+
steps {
21+
// Run Maven on a Unix agent.
22+
sh "mvn -Dmaven.test.failure.ignore=true clean package"
23+
// To run Maven on a Windows agent, use
24+
// bat "mvn -Dmaven.test.failure.ignore=true clean package"
25+
}
26+
post {
27+
// If Maven was able to run the tests, even if some of the test
28+
// failed, record the test results and archive the war file.
29+
success {
30+
junit '**/target/surefire-reports/TEST-*.xml'
31+
archiveArtifacts 'webapp/target/*.war'
32+
}
33+
}
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)