-
Notifications
You must be signed in to change notification settings - Fork 8
/
release.sh
executable file
·46 lines (45 loc) · 1.41 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
#!/bin/bash
# usage: bash release.sh 0.1.0 0.2.0-SNAPSHOT
if [ -n "$1" ] && [ -n "$2" ]; then
# update version to release version
mvn versions:set -DnewVersion=$1
mvn versions:commit
# TODO broadly replace old version by $1
# update tag to release version
bash ./tag.sh $1
# commit
git add .
git commit -m "Release $1"
# deploy
# errors are occurring during deployment; it's necessary to try many times
mvn clean deploy -P!project,release
# tag
git tag -a $1 -m "Requestor $1"
git push origin $1
# site
mvn install -P!project,examples
mvn site -P!project,site # manually commit target/site in gh-pages branch
# update version to next snapshot
mvn versions:set -DnewVersion=$2
mvn versions:commit
# TODO broadly replace $1 by $2
# update tag to next snapshot
bash ./tag.sh HEAD
# commit
git add .
git commit -m "Start $2 development"
# deploy snapshot
mvn clean deploy -P!project
# push
git push origin master
elif [ "snapshot" == "$1" ] || [ "current" == "$1" ]; then
mvn clean install -P!project,examples
mvn site -P!project,site # manually commit target/site in gh-pages branch
mvn clean deploy -P!project
else
echo "USAGE"
echo "1) Release version: sh release.sh {release-version} {next-snapshot}"
echo " Example: sh release.sh 0.1.0 0.2.0-SNAPSHOT"
echo "2) Release snapshot: sh release.sh snapshot"
echo " Alternative: sh release.sh current"
fi