forked from redhat-developer/odo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request redhat-developer#181 from kadel/bump-version
add bump-version.sh script and update contributing.md
- Loading branch information
Showing
2 changed files
with
46 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "****************************************************************************************" | ||
|