-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
32 lines (26 loc) · 943 Bytes
/
Jenkinsfile
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
node {
stage 'checkout'
git 'https://gitlab.com/RavisankarCts/hello-world.git'
stage 'build'
sh 'mvn clean install'
stage('Results - 1') {
junit '**/target/surefire-reports/TEST-*.xml'
archive 'target/*.jar'
}
stage 'bake image'
docker.withRegistry('https://registry.hub.docker.com','docker-hub-credentials') {
def image = docker.build("ravisankar/ravisankardevops:${env.BUILD_TAG}",'.')
stage 'test image'
image.withRun('-p 8888:8888') {springboot ->
sh 'while ! httping -qc1 http://localhost:8888/info; do sleep 1; done'
git 'https://github.com/RavisankarCts/petclinicacceptance.git'
sh 'mvn clean verify'
}
stage('Results') {
junit '**/target/surefire-reports/TEST-*.xml'
archive 'target/*.jar'
}
stage 'push image'
image.push()
}
}