mirror of
https://github.com/jaypyles/Scraperr.git
synced 2025-12-11 18:26:08 +00:00
19 lines
657 B
Bash
Executable File
19 lines
657 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# ARGS
|
|
VERSION_TYPE=$1 # patch, minor, major
|
|
|
|
# Get the current version from the Chart.yaml file
|
|
current_version=$(grep -oP 'version:\s*\K[0-9]+\.[0-9]+\.[0-9]+' helm/Chart.yaml | tr -d '[:space:]')
|
|
|
|
# Increment the version number
|
|
if [ "$VERSION_TYPE" == "patch" ]; then
|
|
new_version=$(echo $current_version | awk -F. -v OFS=. '{$NF++; print}')
|
|
elif [ "$VERSION_TYPE" == "minor" ]; then
|
|
new_version=$(echo $current_version | awk -F. -v OFS=. '{$2++; $3=0; print}')
|
|
elif [ "$VERSION_TYPE" == "major" ]; then
|
|
new_version=$(echo $current_version | awk -F. -v OFS=. '{$1++; $2=0; $3=0; print}')
|
|
fi
|
|
|
|
# Output the new version
|
|
echo "$new_version" |