Files
toolbox-dev-env/.post-commit-hook

21 lines
669 B
Plaintext
Raw Normal View History

2024-12-20 14:53:02 -05:00
#!/usr/bin/env bash
set -e
2024-12-20 14:53:02 -05:00
BASE_IMAGE=$(git config get toolbox-dev-env.base-image.name)
if git config get toolbox-dev-env.base-image.version-script &>/dev/null; then
BASE_IMAGE_VERSION=$(eval $(git config get toolbox-dev-env.base-image.version-script))
2024-12-20 14:53:02 -05:00
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}"