2023-01-05 20:10:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
echo "----------------"
|
|
|
|
echo "Pre-commit hooks"
|
|
|
|
echo "================"
|
2023-01-05 20:56:57 +00:00
|
|
|
BASE_VERSION_NUMBER=$(git describe --tags --abbrev=0)
|
|
|
|
FULL_VERSION_NUMBER=$(git describe --tags)
|
|
|
|
echo "Updating "VERSION_NUMBER" in Dockerfile to $FULL_VERSION_NUMBER"
|
|
|
|
sed -i "s/^ENV VERSION_NUMBER.*$/ENV VERSION_NUMBER ${FULL_VERSION_NUMBER}/" Dockerfile
|
|
|
|
echo "Updating "version" in pyproject.toml to $BASE_VERSION_NUMBER"
|
|
|
|
sed -i "s/^version = \".*\"$/version = \"${BASE_VERSION_NUMBER}\"/" pyproject.toml
|
2023-01-05 20:10:17 +00:00
|
|
|
git add Dockerfile
|
|
|
|
git add pyproject.toml
|
|
|
|
echo "----------------"
|