mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-27 01:15:49 +00:00
aproach with build.sh
This commit is contained in:
parent
c38472dc83
commit
2f13f2ee76
4 changed files with 18 additions and 7 deletions
|
@ -1,5 +1,3 @@
|
|||
FROM openjdk:8-jdk-alpine
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
RUN ./mvnw -B -e dependency:go-offline
|
||||
RUN ./mvnw package
|
||||
CMD [ "./build.sh" ]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
FROM openjdk:8-jre-alpine
|
||||
WORKDIR /app/target
|
||||
COPY app.jar .
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
CMD [ "java", "-jar", "-Dspring.profiles.active=mysql" ,"app.jar" ]
|
||||
COPY /target/app.jar .
|
||||
|
|
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
|
@ -9,11 +9,11 @@ pipeline {
|
|||
dockerfile {
|
||||
filename 'Dockerfile.build'
|
||||
dir '.'
|
||||
args '-v $HOME/.m2:/root/.m2 --name petclinic_build'
|
||||
args '-v $HOME/.m2:/root/.m2'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'docker cp petclinic_build:/build/target/app.jar .'
|
||||
echo 'Build done'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
13
build.sh
Executable file
13
build.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ -f spring-petclinic ]]; then
|
||||
cd spring-petclinic
|
||||
git chekcout jenkins
|
||||
git pull jenkins
|
||||
else
|
||||
git clone https://github.com/hllvc/spring-petclinic.git
|
||||
cd spring-petclinic
|
||||
git checkout jenkins
|
||||
fi
|
||||
|
||||
./mvnw package
|
Loading…
Reference in a new issue