-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new script to update version in pom.xml and README docs. Also updates…
… outdated links in the modules' README files
- Loading branch information
Ajay Kannan
committed
Sep 1, 2015
1 parent
9d3b525
commit 5dc88d7
Showing
7 changed files
with
52 additions
and
16 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
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
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,36 @@ | ||
#!/bin/bash | ||
|
||
# This script updates the READMEs with the latest non-SNAPSHOT version number and increments the SNAPSHOT | ||
# version number in the pom.xml files. | ||
|
||
# Precondition: the pom.xml is at a "-SNAPSHOT" version before running this script. | ||
# Argument (optional): | ||
# $1: new version number for pom.xml files (do not include -SNAPSHOT, that is done automatically). | ||
# Providing no argument defaults to incrementing revision number from x.y.z-SNAPSHOT to x.y.z+1-SNAPSHOT | ||
|
||
# Example: Suppose that before running this script, the pom reads 7.8.9-SNAPSHOT. This script will replace | ||
# all occurrences of #.#.# with 7.8.9 in the README files and the first occurrence of 7.8.9-SNAPSHOT with | ||
# 7.8.10-SNAPSHOT in the pom.xml files. | ||
|
||
# Get the previous maven project version. | ||
CURRENT_SNAPSHOT=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)') | ||
RELEASED_VERSION=${CURRENT_SNAPSHOT%%"-"*} | ||
DEFAULT_UPDATE="${RELEASED_VERSION%.*}.$((${RELEASED_VERSION##*.}+1))" | ||
NEW_SNAPSHOT_VERSION=${1:-$DEFAULT_UPDATE}-SNAPSHOT | ||
|
||
echo "Changing version to $RELEASED_VERSION in README files" | ||
echo "Changing version to $NEW_SNAPSHOT_VERSION in pom.xml files" | ||
|
||
sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" README.md | ||
sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java/README.md | ||
sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java-core/README.md | ||
sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java-datastore/README.md | ||
sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java-examples/README.md | ||
sed -ri "s/[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*/$RELEASED_VERSION/g" gcloud-java-storage/README.md | ||
|
||
sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" pom.xml | ||
sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java/pom.xml | ||
sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java-core/pom.xml | ||
sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java-datastore/pom.xml | ||
sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java-examples/pom.xml | ||
sed -i "0,/$CURRENT_SNAPSHOT/s/$CURRENT_SNAPSHOT/$NEW_SNAPSHOT_VERSION/g" gcloud-java-storage/pom.xml |