#!/usr/bin/sh

set -euo pipefail

# check dockerfile changes
change=$(./hack/generate-dockerfile-from-midstream | md5sum | cut -d ' ' -f1)
if [ "$change" != "$(md5sum Dockerfile | cut -d ' ' -f1)" ] ; then
    echo "A change was found in CI file Dockerfile that was not sourced from the midstream file Dockerfile.in (or vice versa)."
    echo "Please reset the CI file (e.g. Dockerfile), update Dockerfile.in, run make gen-dockerfiles and commit the results"
  exit 1
fi
