another fix

This commit is contained in:
hllvc 2021-07-13 17:40:45 +02:00
parent ed4de7150a
commit dd650e987d
3 changed files with 7 additions and 7 deletions

View file

@ -1,4 +1,5 @@
FROM openjdk:8-jdk-alpine
WORKDIR /build
CMD [ "./build.sh" ]
RUN apk add bash git
COPY build.sh .

9
Jenkinsfile vendored
View file

@ -10,7 +10,7 @@ pipeline {
filename 'Dockerfile.build'
dir '.'
additionalBuildArgs '-t petclinic-build'
args '-v $HOME/.m2:/root/.m2 --name petclinic-build'
args '-v $HOME/.m2:/root/.m2'
}
}
steps {
@ -24,14 +24,13 @@ pipeline {
agent {
docker {
image 'docker:dind'
args '-v /var/run/docker.sock:/var/run/docker.sock'
args '-v /var/run/docker.sock:/var/run/docker.sock --user root'
}
}
steps {
sh """docker run -d --rm \
sh """docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \
--name petclinic-build
petclinic-build"""
--name petclinic-build petclinic-build"""
sh 'docker cp petclinic-build:/build/target/app.jar .'
}
}

View file

@ -1,8 +1,8 @@
#!/bin/bash
if [[ -f spring-petclinic ]]; then
if [[ -e spring-petclinic ]]; then
cd spring-petclinic
git chekcout jenkins
git checkout jenkins
git pull jenkins
else
git clone https://github.com/hllvc/spring-petclinic.git