forked from EBISPOT/zooma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-version.sh
executable file
·52 lines (44 loc) · 1008 Bytes
/
update-version.sh
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
#!/usr/bin/env bash
usage() {
echo "Usage: update-version.sh -v [VERSION NUMBER]"
echo "Required options:"
echo " -v The version to increment the next release to"
}
while getopts "v:h" opt; do
case $opt in
v)
echo "Updating GOCI project version number to $OPTARG"
VERSION=$OPTARG
;;
h)
usage
exit 0
;;
\?)
usage
exit 1
;;
:)
echo "Missing option argument for -$OPTARG"
exit 1
;;
*)
echo "Unimplemented option: -$OPTARG"
exit 1
;;
esac
done
if [ -z "$VERSION" ] ;
then
echo "No version number supplied - please give a non-empty version number to increment to"
exit 1
fi
base=${0%/*}/;
PROJECT_LIST='';
find $base -name 'pom.xml' | while read line; do
if [[ $line != *'.//lodestar/'* ]]
then
sed -i '' "s/\(<zooma.version>\)\([^<]*\)\(<[^>]*\)/\1$VERSION\3/g" $line || exit 1
fi
done
mvn -f $base/pom.xml -N versions:set -DnewVersion=$VERSION || exit 1