Skip to content

Commit

Permalink
Revert "Remove revision variable in pom.xml and update bump-up.sh (#2308
Browse files Browse the repository at this point in the history
)"

This reverts commit 917b786.
  • Loading branch information
junkaixue committed Dec 15, 2022
1 parent fc1d0e1 commit 69dc7d3
Show file tree
Hide file tree
Showing 23 changed files with 51 additions and 21 deletions.
4 changes: 2 additions & 2 deletions bump-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


echo There are $# arguments to $0: $*
version=`grep -A 1 "<artifactId>helix</artifactId>" pom.xml |tail -1 | awk 'BEGIN {FS="[<,>]"};{print $3}'`
version=`grep "<revision>" pom.xml | awk 'BEGIN {FS="[<,>]"};{print $3}'`
if [ "$#" -eq 1 ]; then
new_version=$1
elif [ "$#" -eq 2 ]; then
Expand All @@ -47,7 +47,7 @@ mv helix-view-aggregator/helix-view-aggregator-$version-SNAPSHOT.ivy helix-view-


find . -type f -name '*.ivy' -exec sed -i "s/$version/$new_version/g" {} \;
find . -type f -name 'pom.xml' -exec sed -i "s/$version/$new_version/g" {} \;
find . -type f -name 'pom.xml' -exec sed -i "s/<revision>$version/<revision>$new_version/g" pom.xml;



Expand Down
21 changes: 8 additions & 13 deletions bump-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

update_pom_version() {
pom=$1
version=$2
echo "bump up $pom"
sed -i'' -e "s/${version}/${new_version}/g" "$pom"
version=`get_version_from_pom $pom`
sed -i'' -e "s/<revision>$version/<revision>$new_version/g" $pom
if ! grep -C 1 "$new_version" $pom; then
echo "Failed to update new version $new_version in $pom"
exit 1
Expand All @@ -37,8 +37,7 @@ update_ivy() {
if [ -f $ivy_file ]; then
echo "bump up $ivy_file"
git mv "$ivy_file" "$new_ivy_file"
current_ivy_version=`get_version_from_ivy $new_ivy_file`
sed -i'' -e "s/${current_ivy_version}/${new_version}/g" "$new_ivy_file"
sed -i'' -e "s/${current_version}/${new_version}/g" "$new_ivy_file"
if ! grep -C 1 "$new_version" "$new_ivy_file"; then
echo "Failed to update new version $new_version in $new_ivy_file"
exit 1
Expand All @@ -49,11 +48,7 @@ update_ivy() {
}

get_version_from_pom() {
grep -A 1 "<artifactId>helix</artifactId>" $1 |tail -1 | awk 'BEGIN {FS="[<,>]"};{print $3}'
}

get_version_from_ivy() {
grep revision "$1" | awk 'BEGIN {FS="[=,\"]"};{print $3}'
grep "<revision>" $1 | awk 'BEGIN {FS="[<,>]"};{print $3}'
}

current_version=`get_version_from_pom pom.xml`
Expand All @@ -71,18 +66,18 @@ else
new_version="$major_version.$submajor_version.$new_minor_version"
fi
echo "bump up: $current_version -> $new_version"
update_pom_version "pom.xml" $current_version
update_pom_version "pom.xml"

for module in "metrics-common" "metadata-store-directory-common" "zookeeper-api" "helix-common" "helix-core" \
"helix-admin-webapp" "helix-rest" "helix-lock" "helix-view-aggregator" "helix-agent"; do
update_ivy $module
update_pom_version $module/pom.xml $current_version
update_pom_version $module/pom.xml
done

for module in recipes/task-execution recipes helix-front \
for module in recipes/task-execution recipes \
recipes/distributed-lock-manager recipes/rsync-replicated-file-system \
recipes/rabbitmq-consumer-group recipes/service-discovery; do
update_pom_version $module/pom.xml $current_version
update_pom_version $module/pom.xml
done

#END
1 change: 1 addition & 0 deletions helix-admin-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
com.fasterxml.jackson*,
Expand Down
1 change: 1 addition & 0 deletions helix-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.apache.commons.cli;version="[1.2,2)",
Expand Down
1 change: 1 addition & 0 deletions helix-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.slf4j*;version="[1.7,2)",
org.apache.logging.log4j*;version="[2.17,3)",
Expand Down
1 change: 1 addition & 0 deletions helix-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
javax.management*,
javax.xml.bind*,
Expand Down
4 changes: 4 additions & 0 deletions helix-front/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
<url>http://www.apache.org</url>
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
</properties>

<dependencies>

</dependencies>
Expand Down
1 change: 1 addition & 0 deletions helix-lock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.slf4j*;version="[1.7,2)",
Expand Down
1 change: 1 addition & 0 deletions helix-view-aggregator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ under the License.
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.apache.commons.cli*,
Expand Down
1 change: 1 addition & 0 deletions metadata-store-directory-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.slf4j*;version="[1.7,2)",
org.apache.logging.log4j*;version="[2.17,3)",
Expand Down
1 change: 1 addition & 0 deletions metrics-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.slf4j*;version="[1.7,2)",
org.apache.logging.log4j*;version="[2.17,3)",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
</ciManagement>

<properties>
<revision>1.1.1-SNAPSHOT</revision>
<revision>1.0.5-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>1654806798</project.build.outputTimestamp>

Expand Down
1 change: 1 addition & 0 deletions recipes/distributed-lock-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.slf4j*;version="[1.7,2)",
Expand Down
3 changes: 3 additions & 0 deletions recipes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<url>http://www.apache.org</url>
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
</properties>
<modules>
<module>rabbitmq-consumer-group</module>
<module>rsync-replicated-file-system</module>
Expand Down
1 change: 1 addition & 0 deletions recipes/rabbitmq-consumer-group/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.slf4j*;version="[1.7,2)",
Expand Down
1 change: 1 addition & 0 deletions recipes/rsync-replicated-file-system/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.slf4j*;version="[1.7,2)",
Expand Down
1 change: 1 addition & 0 deletions recipes/service-discovery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.slf4j*;version="[1.7,2)",
Expand Down
3 changes: 3 additions & 0 deletions recipes/task-execution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
<url>http://www.apache.org</url>
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
6 changes: 5 additions & 1 deletion website/0.9.9/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>website</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>0.9.9-docs</artifactId>
Expand All @@ -43,6 +43,10 @@
<url>http://www.apache.org</url>
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
</properties>

<dependencies>
<dependency>
<groupId>org.testng</groupId>
Expand Down
6 changes: 5 additions & 1 deletion website/1.0.2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>website</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>1.0.2-docs</artifactId>
<packaging>bundle</packaging>
<name>Apache Helix :: Website :: 1.0.2</name>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
</properties>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
Expand Down
6 changes: 5 additions & 1 deletion website/1.0.4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>website</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>1.0.4-docs</artifactId>
Expand All @@ -43,6 +43,10 @@
<url>http://www.apache.org</url>
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
</properties>

<dependencies>
<dependency>
<groupId>org.testng</groupId>
Expand Down
4 changes: 2 additions & 2 deletions website/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
Expand Down Expand Up @@ -51,7 +51,7 @@
</modules>

<properties>
<revision>1.1.1-SNAPSHOT</revision>
<revision>1.0.5-SNAPSHOT</revision>
<!-- for svnpubsub site deployment -->
<!-- you can use javasvn too -->
<svnImpl>svn</svnImpl>
Expand Down
1 change: 1 addition & 0 deletions zookeeper-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</organization>

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.slf4j*;version="[1.7,2)",
org.apache.zookeeper*;version="[3.6,3.7)",
Expand Down

0 comments on commit 69dc7d3

Please sign in to comment.