forked from metridoc/metridoc-grails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bumpVersion.sh
executable file
·41 lines (31 loc) · 992 Bytes
/
bumpVersion.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
#!/bin/sh
source helper.sh
MINOR_VERSION=`sed 's/[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/g' VERSION`
MAJOR_VERSION=`sed 's/\([0-9]*\.[0-9]*\).*/\1/g' VERSION`
NEW_VERSION="$MAJOR_VERSION.$((MINOR_VERSION+1))-SNAPSHOT"
echo ""
echo "Bumping version to [$NEW_VERSION]"
echo ""
echo "$NEW_VERSION" > VERSION
systemCall "git add VERSION"
systemCall "git commit -m 'committing a new version'"
systemCall "git push origin master"
echo "resolving metridoc-core first"
cd metridoc-grails-core
systemCall "./grailsw set-version $NEW_VERSION"
systemCall "git add ."
git commit -m"synchronizing version"
systemCall "git push origin master"
cd -
for DIRECTORY in $DIRECTORIES
do
if [ "$DIRECTORY" != "./metridoc-grails-core" ]; then
echo "uploading [$DIRECTORY]"
cd $DIRECTORY
systemCall "./grailsw set-version $NEW_VERSION"
systemCall "git add ."
git commit -m"synchronizing version"
systemCall "git push origin master"
cd -
fi
done