#!/usr/bin/env bash # Two builds of the same sources produce the same image digest. source "$(dirname "$0")/lib.sh" { banner "jib:buildTar twice, compare the image digest and id" for n in 1 2; do "${MVN[@]}" -q clean compile jib:buildTar "${BASE_ARG[@]}" >/dev/null 2>&1 echo "build $n digest=$(cat target/jib-image.digest) id=$(cat target/jib-image.id)" sha256sum target/jib-image.tar | cut -c1-20 | sed "s/^/build $n tar sha256 prefix=/" sleep 2 done banner "Same build with creationTime=USE_CURRENT_TIMESTAMP" for n in 1 2; do "${MVN[@]}" -q clean compile jib:buildTar "${BASE_ARG[@]}" -Djib.container.creationTime=USE_CURRENT_TIMESTAMP >/dev/null 2>&1 echo "build $n digest=$(cat target/jib-image.digest)" sleep 2 done } 2>&1 | clean | tee "$OUT/05-reproducible.txt"