Files
toolbox-dev-env/.post-commit-hook
2024-12-20 14:53:39 -05:00

19 lines
646 B
Bash
Executable File

#!/usr/bin/env bash
BASE_IMAGE=$(git config get toolbox-dev-env.base-image.name)
if git config get toolbox-dev-env.base-image.version-script; then
BASE_IMAGE_VERSION=eval $(git config get toolbox-dev-env.base-image.version-script)
else
BASE_IMAGE_VERSION=$(git config get toolbox-dev-env.base-image.version)
fi
BUILD_NONCE=$(git rev-parse HEAD)
ENV_NAME=$(git config get toolbox-dev-env.name)
podman build . \
--tag "localhost/${ENV_NAME}:latest" \
--build-arg BASE_IMAGE="${BASE_IMAGE}" \
--build-arg BASE_IMAGE_VERSION="${BASE_IMAGE_VERSION}" \
--build-arg BUILD_NONCE="${BUILD_NONCE}" \
--build-arg ENV_NAME="${ENV_NAME}"