diff --git a/scripts/bump-astrolabe.sh b/scripts/bump-astrolabe.sh index c51b8eb..b0ba72d 100755 --- a/scripts/bump-astrolabe.sh +++ b/scripts/bump-astrolabe.sh @@ -2,6 +2,22 @@ # Bump Astrolabe app version set -euo pipefail +# Parse optional --increment flag +INCREMENT="" +while [[ $# -gt 0 ]]; do + case $1 in + --increment) + INCREMENT="$2" + shift 2 + ;; + *) + echo "❌ Error: Unknown option: $1" >&2 + echo "Usage: $0 [--increment PATCH|MINOR|MAJOR]" >&2 + exit 1 + ;; + esac +done + # Validate dependencies command -v uv >/dev/null 2>&1 || { echo "❌ Error: uv not found" >&2 @@ -29,9 +45,18 @@ if [ ! -f "package.json" ]; then fi echo "Bumping Astrolabe version..." +if [ -n "$INCREMENT" ]; then + echo " Forcing $INCREMENT bump" +fi + +# Build commitizen command +CZ_CMD="uv run cz --config .cz.toml bump --yes" +if [ -n "$INCREMENT" ]; then + CZ_CMD="$CZ_CMD --increment $INCREMENT" +fi # Run commitizen bump and capture output -if ! output=$(uv run cz --config .cz.toml bump --yes 2>&1); then +if ! output=$($CZ_CMD 2>&1); then cd ../.. echo "❌ Error: Version bump failed" >&2 echo "$output" >&2 diff --git a/scripts/bump-helm.sh b/scripts/bump-helm.sh index d57aef7..62e8e9e 100755 --- a/scripts/bump-helm.sh +++ b/scripts/bump-helm.sh @@ -2,6 +2,22 @@ # Bump Helm chart version set -euo pipefail +# Parse optional --increment flag +INCREMENT="" +while [[ $# -gt 0 ]]; do + case $1 in + --increment) + INCREMENT="$2" + shift 2 + ;; + *) + echo "❌ Error: Unknown option: $1" >&2 + echo "Usage: $0 [--increment PATCH|MINOR|MAJOR]" >&2 + exit 1 + ;; + esac +done + # Validate dependencies command -v uv >/dev/null 2>&1 || { echo "❌ Error: uv not found" >&2 @@ -24,9 +40,18 @@ if [ ! -f "Chart.yaml" ]; then fi echo "Bumping Helm chart version..." +if [ -n "$INCREMENT" ]; then + echo " Forcing $INCREMENT bump" +fi + +# Build commitizen command +CZ_CMD="uv run cz --config .cz.toml bump --yes" +if [ -n "$INCREMENT" ]; then + CZ_CMD="$CZ_CMD --increment $INCREMENT" +fi # Run commitizen bump and capture output -if ! output=$(uv run cz --config .cz.toml bump --yes 2>&1); then +if ! output=$($CZ_CMD 2>&1); then cd ../.. echo "❌ Error: Version bump failed" >&2 echo "$output" >&2 diff --git a/scripts/bump-mcp.sh b/scripts/bump-mcp.sh index d6b618e..9b39f03 100755 --- a/scripts/bump-mcp.sh +++ b/scripts/bump-mcp.sh @@ -2,6 +2,22 @@ # Bump MCP server version set -euo pipefail +# Parse optional --increment flag +INCREMENT="" +while [[ $# -gt 0 ]]; do + case $1 in + --increment) + INCREMENT="$2" + shift 2 + ;; + *) + echo "❌ Error: Unknown option: $1" >&2 + echo "Usage: $0 [--increment PATCH|MINOR|MAJOR]" >&2 + exit 1 + ;; + esac +done + # Validate dependencies command -v uv >/dev/null 2>&1 || { echo "❌ Error: uv not found" >&2 @@ -16,9 +32,18 @@ if [ ! -f "pyproject.toml" ]; then fi echo "Bumping MCP server version..." +if [ -n "$INCREMENT" ]; then + echo " Forcing $INCREMENT bump" +fi + +# Build commitizen command +CZ_CMD="uv run cz bump --yes" +if [ -n "$INCREMENT" ]; then + CZ_CMD="$CZ_CMD --increment $INCREMENT" +fi # Run commitizen bump and capture output -if ! output=$(uv run cz bump --yes 2>&1); then +if ! output=$($CZ_CMD 2>&1); then echo "❌ Error: Version bump failed" >&2 echo "$output" >&2 echo "" >&2