forked from haster/java-chartjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·56 lines (44 loc) · 1.33 KB
/
release.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
52
53
54
55
#!/bin/bash
set -e
function getVersion {
eval mvn help:evaluate -Dexpression=project.version 2> /dev/null | grep '^[0-9]\+\.'
}
function checkLocaleWijzigingen {
echo -n "Controleren op lokale wijzigingen..."
CHANGES=`git status --porcelain | wc -l`
if [ $CHANGES -gt 0 ]
then
echo ""
show_error "ERROR: Release kan niet gebouwd worden: er zijn nog lokale wijzigingen"
echo -en "\033[0;31m"
git status
echo -en "\033[0m"
exit 1
fi
echo " Geen lokale wijzigingen gevonden"
echo ""
}
function show_error {
echo -e "\033[0;31m$*\033[0m"
}
function syncGit {
git fetch
git checkout master
git fast-forward master
}
checkLocaleWijzigingen
syncGit
CURRENT_SNAPSHOT_VERSION=$(getVersion)
#echo "Current version is: ${CURRENT_SNAPSHOT_VERSION}"
CURRENT_VERSION=`expr $CURRENT_SNAPSHOT_VERSION : '\(.*\)-SNAPSHOT'`
if [ "" == "$CURRENT_VERSION" ]
then
show_error "ERROR: Huidige versie is geen SNAPSHOT versie: $CURRENT_SNAPSHOT_VERSION"
exit 1
fi
export MAVEN_OPTS="-Xmx1024m -Xms512m"
echo "Release van $CURRENT_VERSION"
mvn release:prepare release:perform -Prelease -e -B -ff || {
show_error "ERROR: Release build faalde!"
exit 1
}