From bc0866996edbc83036c6c1df669e16b461202035 Mon Sep 17 00:00:00 2001 From: Dustin Byrne Date: Tue, 17 Dec 2019 15:25:37 -0500 Subject: [PATCH 1/2] Print logs if the test application crashes Logs from stdout/stderr will be printed out if the test application crashes on startup. --- test/entrypoint | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/entrypoint b/test/entrypoint index 1fbef45f..f6da69a4 100755 --- a/test/entrypoint +++ b/test/entrypoint @@ -1,13 +1,21 @@ #!/bin/bash set -e -java -javaagent:/appmap.jar -jar /petclinic.jar &>/dev/null & +LOG_FILE=/tmp/output.log + +java -javaagent:/appmap.jar -jar /petclinic.jar &> ${LOG_FILE} & JVM_PID=$! export WS_URL="http://localhost:8080" printf 'getting set up' while [ -z "$(curl -sI "${WS_URL}" | grep 'HTTP/1.1 200')" ]; do + if ! kill -0 "${JVM_PID}" 2> /dev/null; then + printf '. failed!\n\nprocess exited unexpectedly:\n' + cat "${LOG_FILE}" + exit 1 + fi + printf '.' sleep 1 done From de70a24fad61171bbcad81ee53202a3f69b65101 Mon Sep 17 00:00:00 2001 From: Dustin Byrne Date: Tue, 17 Dec 2019 15:26:39 -0500 Subject: [PATCH 2/2] Build with JDK 8, run with JRE 13 --- test/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/Dockerfile b/test/Dockerfile index 7a806df4..804c8e02 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -1,10 +1,11 @@ -FROM openjdk:12 AS build +FROM openjdk:9 AS build # Build the Spring "Pet Clinic" sample application WORKDIR / RUN mkdir -p /build \ - && yum install -y git \ + && apt-get update + && apt-get install -y git \ && git clone https://github.com/spring-projects/spring-petclinic.git \ && cd spring-petclinic \ && ./mvnw package -Dmaven.test.skip=true \ @@ -22,7 +23,7 @@ ADD src ./src/ RUN ./gradlew --no-daemon build-release \ && mv build/libs/*.jar /build/appmap.jar -FROM openjdk:12-alpine +FROM openjdk:13-alpine LABEL maintainer="Dustin Byrne " RUN apk add -U bash curl git jq \