forked from thejamesthomas/javabank
-
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.
Updating increment_version script so that it works with the version o…
…f sed on the CI server
- Loading branch information
1 parent
02b91c3
commit 5633ad6
Showing
1 changed file
with
11 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,17 @@ MINOR="$(grep minorVersion gradle.properties | cut -d = -f2)" | |
PATCH="$(grep patchVersion gradle.properties | cut -d = -f2)" | ||
NEW_PATCH=$((PATCH + 1)) | ||
|
||
sed -i ".bak" "s/\(patchVersion=\).*/\1$NEW_PATCH/g" gradle.properties | ||
rm gradle.properties.bak | ||
if hash gsed 2>/dev/null; then | ||
#The default version of sed on OSX is not good, so use gsed (which can be installed via | ||
#homebrew with 'brew install gnu-sed') if it's available. I'll want to make this | ||
#a little more robust later on | ||
gsed -i s/patchVersion=$PATCH/patchVersion=$NEW_PATCH/g gradle.properties | ||
else | ||
#I'm assuming that this will be gnu-sed. I'll need to make this a little more | ||
#strict at some point | ||
sed -i s/patchVersion=$PATCH/patchVersion=$NEW_PATCH/g gradle.properties | ||
fi | ||
|
||
git add gradle.properties | ||
git commit --author "CI <[email protected]>" -m "Updating to version $MAJOR.$MINOR.$NEW_PATCH [skip ci]" | ||
git push origin master | ||
git push origin master |