From cdeae3d36a27ec46719cf15db2f28a7ba87a2c49 Mon Sep 17 00:00:00 2001 From: "Greg L. Turnquist" Date: Wed, 9 Jun 2021 15:39:17 -0500 Subject: [PATCH] Bake custom container to run this guide. --- Jenkinsfile | 18 +++++++++++++++++- ci/Dockerfile | 6 ++++++ test/run.sh | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 ci/Dockerfile diff --git a/Jenkinsfile b/Jenkinsfile index bafafc8..23ef118 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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' } } diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000..0a149b8 --- /dev/null +++ b/ci/Dockerfile @@ -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/* diff --git a/test/run.sh b/test/run.sh index b5460ed..183e41f 100755 --- a/test/run.sh +++ b/test/run.sh @@ -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