Skip to content

Commit

Permalink
Remove revision variable in pom.xml and update bump-up.sh (#2308)
Browse files Browse the repository at this point in the history
Remove the revision variable from all pom.xml and update scripts accordingly.
  • Loading branch information
qqu0127 authored Dec 8, 2022
1 parent a2c544f commit 917b786
Show file tree
Hide file tree
Showing 23 changed files with 21 additions and 51 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 "<revision>" pom.xml | awk 'BEGIN {FS="[<,>]"};{print $3}'`
version=`grep -A 1 "<artifactId>helix</artifactId>" pom.xml |tail -1 | 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/<revision>$version/<revision>$new_version/g" pom.xml;
find . -type f -name 'pom.xml' -exec sed -i "s/$version/$new_version/g" {} \;



Expand Down
21 changes: 13 additions & 8 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"
version=`get_version_from_pom $pom`
sed -i'' -e "s/<revision>$version/<revision>$new_version/g" $pom
sed -i'' -e "s/${version}/${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,7 +37,8 @@ update_ivy() {
if [ -f $ivy_file ]; then
echo "bump up $ivy_file"
git mv "$ivy_file" "$new_ivy_file"
sed -i'' -e "s/${current_version}/${new_version}/g" "$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"
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 @@ -48,7 +49,11 @@ update_ivy() {
}

get_version_from_pom() {
grep "<revision>" $1 | awk 'BEGIN {FS="[<,>]"};{print $3}'
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}'
}

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

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
update_pom_version $module/pom.xml $current_version
done

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

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

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
com.fasterxml.jackson*,
Expand Down
1 change: 0 additions & 1 deletion helix-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
</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: 0 additions & 1 deletion helix-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
</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: 0 additions & 1 deletion helix-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
</organization>

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

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

<dependencies>

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

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

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.apache.commons.cli*,
Expand Down
1 change: 0 additions & 1 deletion metadata-store-directory-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
</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: 0 additions & 1 deletion metrics-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
</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.0.5-SNAPSHOT</revision>
<revision>1.1.1-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>1670405428</project.build.outputTimestamp>

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

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.slf4j*;version="[1.7,2)",
Expand Down
3 changes: 0 additions & 3 deletions recipes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
<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: 0 additions & 1 deletion recipes/rabbitmq-consumer-group/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
</organization>

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

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

<properties>
<revision>1.0.5-SNAPSHOT</revision>
<osgi.import>
org.apache.helix*,
org.slf4j*;version="[1.7,2)",
Expand Down
3 changes: 0 additions & 3 deletions recipes/task-execution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
<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: 1 addition & 5 deletions 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>${revision}</version>
<version>1.1.1-SNAPSHOT</version>
</parent>

<artifactId>0.9.9-docs</artifactId>
Expand All @@ -43,10 +43,6 @@
<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: 1 addition & 5 deletions website/1.0.2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>website</artifactId>
<version>${revision}</version>
<version>1.1.1-SNAPSHOT</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: 1 addition & 5 deletions 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>${revision}</version>
<version>1.1.1-SNAPSHOT</version>
</parent>

<artifactId>1.0.4-docs</artifactId>
Expand All @@ -43,10 +43,6 @@
<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>${revision}</version>
<version>1.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
Expand Down Expand Up @@ -51,7 +51,7 @@
</modules>

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

Please sign in to comment.