forked from open-eid/cdoc2-java-ref-impl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_release.sh
executable file
·42 lines (34 loc) · 1 KB
/
prepare_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
#!/bin/bash
GIT_BRANCH=$(git branch --show-current)
if [[ "master" != "$GIT_BRANCH" ]]; then
echo "Release will be made from branch $GIT_BRANCH."
sleep 5
fi
if [[ -n $(git cherry -v) ]]; then
echo "Detected unpushed commits. Exit"
exit 1
fi
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
echo "Uncommitted changes detected. Exit"
exit 1
fi
while getopts "v:" opt; do
case $opt in
v)
echo "Changing parent pom version to: $OPTARG" >&2
mvn versions:set -DnewVersion="${OPTARG}" -DupdateMatchingVersions=false
;;
?)
echo "Invalid option: -${OPTARG}."
exit 1
;;
esac
done
# replace module -SNAPSHOT version with release version (non-SNAPSHOT)
mvn versions:set -DremoveSnapshot
mvn versions:set -DremoveSnapshot -pl cdoc2-schema
mvn versions:set -DremoveSnapshot -pl cdoc2-client
mvn versions:set -DremoveSnapshot -pl cdoc2-lib
mvn versions:set -DremoveSnapshot -pl cdoc2-cli
# build and install into local maven package repository
mvn install