add bump-version.sh script and update contributing.md

bump-version.sh is there to make it easier to changes version number when doing release.
It upates version number in README.md, cmd/version.go and install.sh.
This commit is contained in:
Tomas Kral
2018-03-06 08:39:16 +01:00
parent 1a7d96457e
commit 15015e014c
2 changed files with 46 additions and 4 deletions

38
scripts/bump-version.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
# this scripts updates version number in ocdev source code
# run this script from source root with new version as an argument (./scripts/bump-version.sh v0.0.2 )
NEW_VERSION=$1
if [[ -z "${NEW_VERSION}" ]]; then
echo "Version number is missing."
echo "One argument required."
echo "example: $0 v0.0.2"
exit 1
fi
check_version(){
file=$1
grep ${NEW_VERSION} $file
echo ""
}
echo "* Bumping version in README.md"
sed -i "s/v[0-9]*\.[0-9]*\.[0-9]*/${NEW_VERSION}/g" README.md
check_version README.md
echo "* Bumping version in cmd/version.go"
sed -i "s/\(VERSION = \)\"v[0-9]*\.[0-9]*\.[0-9]*\"/\1\"${NEW_VERSION}\"/g" cmd/version.go
check_version cmd/version.go
echo "* Bumping version in scripts/install.sh"
sed -i "s/\(LATEST_VERSION=\)\"v[0-9]*\.[0-9]*\.[0-9]*\"/\1\"${NEW_VERSION}\"/g" scripts/install.sh
check_version scripts/install.sh
echo "****************************************************************************************"
echo "* Don't forget to update homebrew package at https://github.com/kadel/homebrew-ocdev ! *"
echo "****************************************************************************************"