mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-27 01:15:49 +00:00
i hope finally it works
This commit is contained in:
parent
486db094bb
commit
755cb1e043
3 changed files with 5 additions and 14 deletions
|
@ -2,4 +2,4 @@ FROM openjdk:8-jre-alpine
|
|||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
CMD [ "java", "-jar", "-Dspring.profiles.active=mysql" ,"app.jar" ]
|
||||
COPY /target/app.jar .
|
||||
COPY app.jar .
|
||||
|
|
15
Jenkinsfile
vendored
15
Jenkinsfile
vendored
|
@ -2,10 +2,6 @@ pipeline {
|
|||
|
||||
agent any
|
||||
|
||||
environment {
|
||||
BUILD_CONTAINER_ID='test'
|
||||
}
|
||||
|
||||
stages {
|
||||
|
||||
stage('Build') {
|
||||
|
@ -14,16 +10,12 @@ pipeline {
|
|||
filename 'Dockerfile.build'
|
||||
dir '.'
|
||||
additionalBuildArgs '-t petclinic-build'
|
||||
args '$HOME/.m2:/root/.m2'
|
||||
args '-v $HOME/.m2:/root/.m2'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'docker run -v $HOME/.m2:/root/.m2 -d petclinic-build > id'
|
||||
script {
|
||||
BUILD_CONTAINER_ID = sh(
|
||||
script: 'echo $(cat id)'
|
||||
).trim()
|
||||
}
|
||||
sh 'docker run -v $HOME/.m2:/root/.m2 --name petclinic-build petclinic-build'
|
||||
sh 'docker cp petclinic-build:/build/spring-petclinic/target/app.jar .'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +27,6 @@ pipeline {
|
|||
}
|
||||
}
|
||||
steps {
|
||||
sh 'docker cp ${BUILD_CONTAINER_ID}:/build/target/app.jar .'
|
||||
sh 'docker-compose up'
|
||||
/* sh 'docker run -it --rm -p 8080:8080 petclinic-run' */
|
||||
}
|
||||
|
|
2
build.sh
2
build.sh
|
@ -10,4 +10,4 @@ else
|
|||
git checkout jenkins
|
||||
fi
|
||||
|
||||
./mvnw package
|
||||
./mvnw package -DskipTests
|
||||
|
|
Loading…
Reference in a new issue