mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-27 09:25: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
|
WORKDIR /app
|
||||||
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 .
|
COPY app.jar .
|
||||||
|
|
15
Jenkinsfile
vendored
15
Jenkinsfile
vendored
|
@ -2,10 +2,6 @@ pipeline {
|
||||||
|
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
environment {
|
|
||||||
BUILD_CONTAINER_ID='test'
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
|
@ -14,16 +10,12 @@ pipeline {
|
||||||
filename 'Dockerfile.build'
|
filename 'Dockerfile.build'
|
||||||
dir '.'
|
dir '.'
|
||||||
additionalBuildArgs '-t petclinic-build'
|
additionalBuildArgs '-t petclinic-build'
|
||||||
args '$HOME/.m2:/root/.m2'
|
args '-v $HOME/.m2:/root/.m2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'docker run -v $HOME/.m2:/root/.m2 -d petclinic-build > id'
|
sh 'docker run -v $HOME/.m2:/root/.m2 --name petclinic-build petclinic-build'
|
||||||
script {
|
sh 'docker cp petclinic-build:/build/spring-petclinic/target/app.jar .'
|
||||||
BUILD_CONTAINER_ID = sh(
|
|
||||||
script: 'echo $(cat id)'
|
|
||||||
).trim()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +27,6 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'docker cp ${BUILD_CONTAINER_ID}:/build/target/app.jar .'
|
|
||||||
sh 'docker-compose up'
|
sh 'docker-compose up'
|
||||||
/* sh 'docker run -it --rm -p 8080:8080 petclinic-run' */
|
/* sh 'docker run -it --rm -p 8080:8080 petclinic-run' */
|
||||||
}
|
}
|
||||||
|
|
2
build.sh
2
build.sh
|
@ -10,4 +10,4 @@ else
|
||||||
git checkout jenkins
|
git checkout jenkins
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./mvnw package
|
./mvnw package -DskipTests
|
||||||
|
|
Loading…
Reference in a new issue