Moved to hatch vcs to improve oci container cacheing performance.

This commit is contained in:
2026-09-15 16:16:16 +00:00
parent d288523d4e
commit e06e077ebe
13 changed files with 55 additions and 89 deletions
+34 -7
View File
@@ -3,14 +3,41 @@ set -euo pipefail
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
cd "$parent_path" || exit
#./lint.sh
if [ 1 -eq "$#" ]
then
./version_bump.sh "$1"
if [ $# -ne 1 ]; then
echo "Usage: $0 <major|minor|patch|version_string>"
exit 1
fi
current_version=$(grep -m 1 '^version = ' brewman/pyproject.toml | sed -E 's/version = "([^"]+)"/\1/')
make build-production TAG="$current_version"
if git describe --exact-match --tags HEAD >/dev/null 2>&1; then
existing_tag=$(git describe --exact-match --tags HEAD)
echo "Current commit is already tagged with $existing_tag. Skipping tag creation."
new_version=${existing_tag#v}
else
current_version=$(git describe --tags --abbrev=0 | sed 's/^v//')
IFS='.' read -r major minor patch <<< "$current_version"
if [ "$1" == "major" ]; then
major=$((major + 1)); minor=0; patch=0
new_version="${major}.${minor}.${patch}"
elif [ "$1" == "minor" ]; then
minor=$((minor + 1)); patch=0
new_version="${major}.${minor}.${patch}"
elif [ "$1" == "patch" ]; then
patch=$((patch + 1))
new_version="${major}.${minor}.${patch}"
elif [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
new_version="$1"
else
echo "Invalid argument: must be 'major', 'minor', 'patch', or a specific version (e.g. 1.2.3)"
exit 1
fi
echo "Tagging v$new_version"
git tag "v$new_version"
fi
git push
git push --tags
make build-production TAG="$new_version"
cd "$parent_path/ansible" || exit
ansible-playbook --inventory=hosts playbook.yml