#!/usr/bin/env bash # Shared setup for the scenario scripts. Source it; do not run it. set -euo pipefail HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" MODULE="$(cd "$HERE/.." && pwd)" OUT="$MODULE/output" mkdir -p "$OUT" cd "$MODULE" # JDK: use JAVA_HOME if the caller set it (the post was tested with Temurin 25.0.5.1+2). export PATH="${JAVA_HOME:+$JAVA_HOME/bin:}$PATH" # Base image source. "docker://" makes Jib read the base from the local Docker daemon instead of # Docker Hub. The sandbox used for the post hit Docker Hub's anonymous pull limit (HTTP 429), so # the scripts default to the daemon copy. Set JIB_BASE="" to let Jib pull eclipse-temurin:25-jre # from the registry (Jib's default for Java 25). JIB_BASE="${JIB_BASE-docker://eclipse-temurin:25-jre}" BASE_ARG=() [ -n "$JIB_BASE" ] && BASE_ARG=("-Djib.from.image=$JIB_BASE") MVN=(mvn -B -ntp) # Strip JVM-launcher noise and wall-clock lines that would make every rerun diff. clean() { grep -v -E '^Picked up|^WARNING:|Finished at:|^\[INFO\] *$' ; } banner() { printf '\n=== %s ===\n' "$*"; } # Buildpacks arguments. In the sandbox the builder container needs the proxy and its CA (-Pcorp-proxy); # on an open network leave PROXY_URL unset and these stay empty. BP_ARGS=(-DskipTests -Dspring-boot.build-image.pullPolicy=IF_NOT_PRESENT) if [ -n "${PROXY_URL:-}" ]; then BP_ARGS+=(-Pcorp-proxy "-Dproxy.url=$PROXY_URL" "-Dca.dir=${CA_DIR:?set CA_DIR to a folder holding type + ca.crt}") fi