mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-27 09:25: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
|
FROM openjdk:8-jdk-alpine
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY . .
|
CMD [ "./build.sh" ]
|
||||||
RUN ./mvnw -B -e dependency:go-offline
|
|
||||||
RUN ./mvnw package
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
FROM openjdk:8-jre-alpine
|
FROM openjdk:8-jre-alpine
|
||||||
WORKDIR /app/target
|
WORKDIR /app
|
||||||
COPY app.jar .
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD [ "java", "-jar", "-Dspring.profiles.active=mysql" ,"app.jar" ]
|
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 {
|
dockerfile {
|
||||||
filename 'Dockerfile.build'
|
filename 'Dockerfile.build'
|
||||||
dir '.'
|
dir '.'
|
||||||
args '-v $HOME/.m2:/root/.m2 --name petclinic_build'
|
args '-v $HOME/.m2:/root/.m2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
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