You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2022/11/03 18:19:39 UTC
[helix] branch master updated: Improve Helix build tooling and CI (#2262)
This is an automated email from the ASF dual-hosted git repository.
jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/master by this push:
new 0d973dfca Improve Helix build tooling and CI (#2262)
0d973dfca is described below
commit 0d973dfca84437ac6d74b9d08301876827713156
Author: Qi (Quincy) Qu <qq...@linkedin.com>
AuthorDate: Thu Nov 3 11:19:34 2022 -0700
Improve Helix build tooling and CI (#2262)
Improve Helix build tooling and CI
---
bump-snapshot.command => bump-snapshot.sh | 7 ++-
bump-up.command | 79 ----------------------------
bump-up.sh | 76 ++++++++++++++++++++++++++
helix-admin-webapp/pom.xml | 2 +-
helix-agent/pom.xml | 2 +-
helix-common/pom.xml | 2 +-
helix-core/pom.xml | 2 +-
helix-front/pom.xml | 2 +-
helix-lock/pom.xml | 2 +-
helix-rest/pom.xml | 4 +-
helix-view-aggregator/pom.xml | 2 +-
metadata-store-directory-common/pom.xml | 2 +-
metrics-common/pom.xml | 2 +-
pom.xml | 4 +-
recipes/distributed-lock-manager/pom.xml | 2 +-
recipes/pom.xml | 2 +-
recipes/rabbitmq-consumer-group/pom.xml | 2 +-
recipes/rsync-replicated-file-system/pom.xml | 2 +-
recipes/service-discovery/pom.xml | 2 +-
recipes/task-execution/pom.xml | 2 +-
website/0.9.9/pom.xml | 2 +-
website/1.0.2/pom.xml | 2 +-
website/1.0.4/pom.xml | 2 +-
website/pom.xml | 2 +-
zookeeper-api/pom.xml | 2 +-
25 files changed, 105 insertions(+), 105 deletions(-)
diff --git a/bump-snapshot.command b/bump-snapshot.sh
similarity index 91%
rename from bump-snapshot.command
rename to bump-snapshot.sh
index 8a557ae15..94de7acc5 100755
--- a/bump-snapshot.command
+++ b/bump-snapshot.sh
@@ -21,7 +21,10 @@
echo There are $# arguments to $0: $*
-if [ "$#" -eq 2 ]; then
+version=`grep "<revision>" pom.xml | awk 'BEGIN {FS="[<,>]"};{print $3}'`
+if [ "$#" -eq 1 ]; then
+ new_version=$1
+elif [ "$#" -eq 2 ]; then
version=$1
new_version=$2
else
@@ -44,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" {} \;
+sed -i "s/<revision>$version/<revision>$new_version/g" pom.xml;
diff --git a/bump-up.command b/bump-up.command
deleted file mode 100755
index 89feb3ef3..000000000
--- a/bump-up.command
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-MODULES=("metrics-common" "metadata-store-directory-common" "zookeeper-api" "helix-common" "helix-core" \
-"helix-admin-webapp" "helix-front" "helix-rest" "helix-lock" "helix-view-aggregator" "helix-agent")
-
-update_pom_version() {
- pom=$1
- echo "bump up $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
- fi
-}
-
-update_ivy() {
- module=$1
- ivy_file="$module-$version.ivy"
- new_ivy_file="$module-$new_version.ivy"
- if [ -f $module/$ivy_file ]; then
- echo "bump up $module/$ivy_file"
- git mv "$module/$ivy_file" "$module/$new_ivy_file"
- sed -i'' -e "s/${version}/${new_version}/g" "$module/$new_ivy_file"
- if ! grep -C 1 "$new_version" "$module/$new_ivy_file"; then
- echo "Failed to update new version $new_version in $module/$new_ivy_file"
- exit 1
- fi
- else
- echo "$module/$ivy_file not exist"
- fi
-}
-
-echo There are $# arguments to $0: $*
-if [ "$#" -eq 2 ]; then
- version=$1
- new_version=$2
-else
- version=`grep -A 1 "<artifactId>helix</artifactId>" pom.xml | grep "<version>" | awk 'BEGIN {FS="[<,>]"};{print $3}'`
- minor_version=`echo $version | cut -d'.' -f3`
- major_version=`echo $version | cut -d'.' -f1` # should be 0
- submajor_version=`echo $version | cut -d'.' -f2`
-
- new_minor_version=`expr $minor_version + 1`
- new_version="$major_version.$submajor_version.$new_minor_version"
-fi
-echo "bump up: $version -> $new_version"
-update_pom_version "pom.xml"
-
-for module in "${MODULES[@]}"; do
- update_pom_version "$module/pom.xml"
- update_ivy $module
-done
-
-for pom in recipes/task-execution/pom.xml recipes/pom.xml \
- recipes/distributed-lock-manager/pom.xml recipes/rsync-replicated-file-system/pom.xml \
- recipes/rabbitmq-consumer-group/pom.xml recipes/service-discovery/pom.xml; do
- update_pom_version $pom
-done
-
-#END
diff --git a/bump-up.sh b/bump-up.sh
new file mode 100755
index 000000000..7c688e683
--- /dev/null
+++ b/bump-up.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+update_pom_version() {
+ pom=$1
+ echo "bump up $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
+ fi
+}
+
+update_ivy() {
+ module=$1
+ ivy_file=`find $module -type f -name '*.ivy'`
+ new_ivy_file="$module/$module-$new_version.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"
+ if ! grep -C 1 "$new_version" "$new_ivy_file"; then
+ echo "Failed to update new version $new_version in $new_ivy_file"
+ exit 1
+ fi
+ else
+ echo "$module/$ivy_file not exist"
+ fi
+}
+
+get_version_from_pom() {
+ grep "<revision>" $1 | awk 'BEGIN {FS="[<,>]"};{print $3}'
+}
+
+current_version=`get_version_from_pom pom.xml`
+echo There are $# arguments to $0: $*
+if [ "$#" -eq 1 ]; then
+ new_version=$1
+elif [ "$#" -eq 2 ]; then
+ new_version=$2
+else
+ minor_version=`echo $current_version | cut -d'.' -f3 | cut -d'-' -f1`
+ major_version=`echo $current_version | cut -d'.' -f1`
+ submajor_version=`echo $current_version | cut -d'.' -f2`
+
+ new_minor_version=`expr $minor_version + 1`
+ new_version="$major_version.$submajor_version.$new_minor_version"
+fi
+echo "bump up: $current_version -> $new_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
+done
+
+#END
diff --git a/helix-admin-webapp/pom.xml b/helix-admin-webapp/pom.xml
index e82c752ae..8bef6f49b 100644
--- a/helix-admin-webapp/pom.xml
+++ b/helix-admin-webapp/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/helix-agent/pom.xml b/helix-agent/pom.xml
index 87d4028a1..0fba357e9 100644
--- a/helix-agent/pom.xml
+++ b/helix-agent/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>helix-agent</artifactId>
<packaging>bundle</packaging>
diff --git a/helix-common/pom.xml b/helix-common/pom.xml
index 79a1df2ad..e57ca07ed 100644
--- a/helix-common/pom.xml
+++ b/helix-common/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/helix-core/pom.xml b/helix-core/pom.xml
index baa251d95..c68ce6fae 100755
--- a/helix-core/pom.xml
+++ b/helix-core/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/helix-front/pom.xml b/helix-front/pom.xml
index 79a9081e6..a5a9b7ea0 100644
--- a/helix-front/pom.xml
+++ b/helix-front/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/helix-lock/pom.xml b/helix-lock/pom.xml
index 42093a18e..99cc5d88b 100644
--- a/helix-lock/pom.xml
+++ b/helix-lock/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/helix-rest/pom.xml b/helix-rest/pom.xml
index 631d98e18..6ebcad8fd 100644
--- a/helix-rest/pom.xml
+++ b/helix-rest/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -48,7 +48,7 @@
<dependency>
<groupId>org.apache.helix</groupId>
<artifactId>metadata-store-directory-common</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
diff --git a/helix-view-aggregator/pom.xml b/helix-view-aggregator/pom.xml
index df50d8fea..793a14800 100644
--- a/helix-view-aggregator/pom.xml
+++ b/helix-view-aggregator/pom.xml
@@ -21,7 +21,7 @@ under the License.
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/metadata-store-directory-common/pom.xml b/metadata-store-directory-common/pom.xml
index fde53ae30..611901875 100644
--- a/metadata-store-directory-common/pom.xml
+++ b/metadata-store-directory-common/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/metrics-common/pom.xml b/metrics-common/pom.xml
index 50d9fabe7..8ecb8a2b9 100644
--- a/metrics-common/pom.xml
+++ b/metrics-common/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/pom.xml b/pom.xml
index 8a7c94fff..ff2950dfa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
<packaging>pom</packaging>
<name>Apache Helix</name>
@@ -397,7 +397,7 @@
</ciManagement>
<properties>
-
+ <revision>1.0.5-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>1654806798</project.build.outputTimestamp>
diff --git a/recipes/distributed-lock-manager/pom.xml b/recipes/distributed-lock-manager/pom.xml
index b099c4d7c..e44c26fb8 100644
--- a/recipes/distributed-lock-manager/pom.xml
+++ b/recipes/distributed-lock-manager/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix.recipes</groupId>
<artifactId>recipes</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>distributed-lock-manager</artifactId>
diff --git a/recipes/pom.xml b/recipes/pom.xml
index f10479958..ff48cf1b8 100644
--- a/recipes/pom.xml
+++ b/recipes/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<groupId>org.apache.helix.recipes</groupId>
<artifactId>recipes</artifactId>
diff --git a/recipes/rabbitmq-consumer-group/pom.xml b/recipes/rabbitmq-consumer-group/pom.xml
index 0bb4a0225..f048df2ec 100644
--- a/recipes/rabbitmq-consumer-group/pom.xml
+++ b/recipes/rabbitmq-consumer-group/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.helix.recipes</groupId>
<artifactId>recipes</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>rabbitmq-consumer-group</artifactId>
diff --git a/recipes/rsync-replicated-file-system/pom.xml b/recipes/rsync-replicated-file-system/pom.xml
index 2b5ba1417..7e10f44ed 100644
--- a/recipes/rsync-replicated-file-system/pom.xml
+++ b/recipes/rsync-replicated-file-system/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix.recipes</groupId>
<artifactId>recipes</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>rsync-replicated-file-system</artifactId>
diff --git a/recipes/service-discovery/pom.xml b/recipes/service-discovery/pom.xml
index 13d86288a..89bc2131e 100644
--- a/recipes/service-discovery/pom.xml
+++ b/recipes/service-discovery/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix.recipes</groupId>
<artifactId>recipes</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>service-discovery</artifactId>
diff --git a/recipes/task-execution/pom.xml b/recipes/task-execution/pom.xml
index 56fce1662..3afba7048 100644
--- a/recipes/task-execution/pom.xml
+++ b/recipes/task-execution/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix.recipes</groupId>
<artifactId>recipes</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>task-execution</artifactId>
diff --git a/website/0.9.9/pom.xml b/website/0.9.9/pom.xml
index 19c02163a..362d0979c 100644
--- a/website/0.9.9/pom.xml
+++ b/website/0.9.9/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>website</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>0.9.9-docs</artifactId>
diff --git a/website/1.0.2/pom.xml b/website/1.0.2/pom.xml
index eb1d9f185..58faa93e1 100644
--- a/website/1.0.2/pom.xml
+++ b/website/1.0.2/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>website</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>1.0.2-docs</artifactId>
diff --git a/website/1.0.4/pom.xml b/website/1.0.4/pom.xml
index f0bdf130f..9f5da5d80 100644
--- a/website/1.0.4/pom.xml
+++ b/website/1.0.4/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>website</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<artifactId>1.0.4-docs</artifactId>
diff --git a/website/pom.xml b/website/pom.xml
index 6ff032cba..84bfd8739 100644
--- a/website/pom.xml
+++ b/website/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
diff --git a/zookeeper-api/pom.xml b/zookeeper-api/pom.xml
index 646bbd975..db6ecf5a2 100644
--- a/zookeeper-api/pom.xml
+++ b/zookeeper-api/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.helix</groupId>
<artifactId>helix</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>