Bake custom container to run this guide.

This commit is contained in:
Greg L. Turnquist
2021-06-09 15:39:17 -05:00
parent 759783e3ec
commit cdeae3d36a
3 changed files with 24 additions and 2 deletions

18
Jenkinsfile vendored
View File

@@ -11,10 +11,26 @@ pipeline {
}
stages {
stage('Publish OpenJDK 8 + git') {
when {
changeset "ci/Dockerfile"
}
agent any
steps {
script {
def image = docker.build("springci/gs-consuming-web-service-and-git", "ci/")
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
image.push()
}
}
}
}
stage("test: baseline (jdk8)") {
agent {
docker {
image 'adoptopenjdk/openjdk8:latest'
image 'springci/gs-consuming-web-service-and-git:latest'
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
}
}

6
ci/Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM adoptopenjdk/openjdk8:latest
RUN apt-get update && apt-get install -y git
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/*

View File

@@ -2,7 +2,7 @@
cd $(dirname $0)
git clone https://github.com/spring-guides/gs-producing-web-service
(cd gs-producing-web-service/complete; ./mvnw install; ./mvnw spring-boot:run &)
(cd gs-producing-web-service/complete; ./mvnw clean install spring-boot:run &)
sleep 10