forked from apache/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bump-up.command
executable file
·108 lines (93 loc) · 3.78 KB
/
bump-up.command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/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.
#
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=`echo $version | sed -e "s/${minor_version}/${new_minor_version}/g"`
new_version="$major_version.$submajor_version.$new_minor_version"
fi
echo "bump up: $version -> $new_version"
#: <<'END'
echo "bump up pom.xml"
sed -i "s/${version}/${new_version}/g" pom.xml
# git diff pom.xml
grep -C 1 "$new_version" pom.xml
echo "bump up helix-core/pom.xml"
sed -i "s/${version}/${new_version}/g" helix-core/pom.xml
grep -C 1 "$new_version" helix-core/pom.xml
# git diff helix-core/pom.xml
ivy_file="helix-core-"$version".ivy"
new_ivy_file="helix-core-"$new_version".ivy"
# echo "$ivy_file"
if [ -f helix-core/$ivy_file ]; then
echo "bump up helix-core/$ivy_file"
git mv "helix-core/$ivy_file" "helix-core/$new_ivy_file"
sed -i "s/${version}/${new_version}/g" "helix-core/$new_ivy_file"
grep -C 1 "$new_version" "helix-core/$new_ivy_file"
else
echo "helix-core/$ivy_file not exist"
fi
echo "bump up helix-admin-webapp/pom.xml"
sed -i "s/${version}/${new_version}/g" helix-admin-webapp/pom.xml
grep -C 1 "$new_version" helix-admin-webapp/pom.xml
# git diff helix-admin-webapp/pom.xml
ivy_file="helix-admin-webapp-"$version".ivy"
new_ivy_file="helix-admin-webapp-"$new_version".ivy"
# echo "$ivy_file"
if [ -f helix-admin-webapp/$ivy_file ]; then
echo "bump up helix-admin-webapp/$ivy_file"
git mv "helix-admin-webapp/$ivy_file" "helix-admin-webapp/$new_ivy_file"
sed -i "s/${version}/${new_version}/g" "helix-admin-webapp/$new_ivy_file"
grep -C 1 "$new_version" "helix-admin-webapp/$new_ivy_file"
else
echo "helix-admin-webapp/$ivy_file not exist"
fi
echo "bump up helix-rest/pom.xml"
sed -i "s/${version}/${new_version}/g" helix-rest/pom.xml
grep -C 1 "$new_version" helix-rest/pom.xml
# git diff helix-rest/pom.xml
ivy_file="helix-rest-"$version".ivy"
new_ivy_file="helix-rest-"$new_version".ivy"
# echo "$ivy_file"
if [ -f helix-rest/$ivy_file ]; then
echo "bump up helix-rest/$ivy_file"
git mv "helix-rest/$ivy_file" "helix-rest/$new_ivy_file"
sed -i "s/${version}/${new_version}/g" "helix-rest/$new_ivy_file"
grep -C 1 "$new_version" "helix-rest/$new_ivy_file"
else
echo "helix-rest/$ivy_file not exist"
fi
for POM in helix-agent/pom.xml 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
echo "bump up $POM"
sed -i "s/${version}/${new_version}/g" $POM
grep -C 1 "$new_version" $POM
done
echo "bump up helix-front/pom.xml"
sed -i "s/${version}/${new_version}/g" helix-front/pom.xml
grep -C 1 "$new_version" helix-front/pom.xml
#END