-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add make target to prepare a relase (#345)
It will bump version and prepare description with commits, after that version/description has to be manually edited to fix TODOs. New make targets: make prepare-patch make prepare-minor make prepare-major Signed-off-by: Quique Llorente <[email protected]>
- Loading branch information
Showing
5 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash -e | ||
|
||
expected_types="(major|minor|patch)" | ||
current_type=$1 | ||
|
||
bump() { | ||
version=$(hack/version.sh) | ||
version_part=$(echo $version |sed $1) | ||
version_part=$((++version_part)) | ||
version=$(echo $version | sed $2 | sed "s/version_part/$version_part/g") | ||
./hack/version.sh $version | ||
} | ||
|
||
bump_major() { | ||
bump "s/^v\(.*\)[.].*[.].*$/\1/g" "s/^v\(.*\)[.]\(.*\)[.]\(.*\)$/version_part.\2.\3/g" | ||
} | ||
|
||
bump_minor() { | ||
bump "s/^v.*[.]\(.*\)[.].*$/\1/g" "s/^v\(.*\)[.]\(.*\)[.]\(.*\)$/\1.version_part.\3/g" | ||
} | ||
|
||
bump_patch() { | ||
bump "s/^v.*[.].*[.]\(.*\)$/\1/g" "s/^v\(.*\)[.]\(.*\)[.]\(.*\)$/\1.\2.version_part/g" | ||
} | ||
|
||
if [[ ! $current_type =~ $expected_types ]]; then | ||
echo "Usage: $0 $expected_types" | ||
exit 1 | ||
fi | ||
|
||
bump_$current_type | ||
hack/version.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash -e | ||
version_type=$1 | ||
old_version=$(hack/version.sh) | ||
new_version=$(hack/bump-version.sh $version_type) | ||
commits=$(git log --pretty=format:"* %s" $old_version..HEAD) | ||
|
||
|
||
cat << EOF > version/description | ||
$new_version | ||
TODO: Add description here | ||
TODO: keep at every category the | ||
commits that make sense | ||
Features: | ||
$commits | ||
Bugs: | ||
$commits | ||
Docs: | ||
$commits | ||
\`\`\` | ||
docker pull HANDLER_IMAGE | ||
\`\`\` | ||
EOF | ||
|
||
${EDITOR:-vi} version/description | ||
|
||
git checkout -b release-$new_version | ||
git commit -a -s -m "Release $new_version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
#!/bin/bash -e | ||
grep = version/version.go | sed -r 's/.*= \"(.*)"$$/v\1/g' | ||
version_file=version/version.go | ||
# If we don't pass a version just show current one | ||
if [ -z "$1" ]; then | ||
grep = $version_file | sed -r 's/.*= \"(.*)"$$/v\1/g' | ||
# else change it | ||
else | ||
sed -i "s/= \".*\"$/= \"$1\"/g" $version_file | ||
fi |