mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
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:
38
scripts/bump-version.sh
Executable file
38
scripts/bump-version.sh
Executable 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 "****************************************************************************************"
|
||||
|
||||
Reference in New Issue
Block a user