-
Notifications
You must be signed in to change notification settings - Fork 7
/
release.sh
executable file
·39 lines (33 loc) · 1.02 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
#!/bin/sh
set -eu
INTERNAL_RELEASE=true
# Parses command line arguments
# If called with -p, a public release is made
# If called with -h, help text is displayed
# If called without any arg, an internal release is made
while getopts 'ph' OPTION; do
case "$OPTION" in
p)
INTERNAL_RELEASE=false
;;
?)
echo "Makes an internal release, unless -p (public) flag is set. script usage: $(basename "$0") [-h] [-p]" >&2
exit 1
;;
esac
done
shift "$((OPTIND -1))"
# Checks that required environment variables are set
[ -z "$REPO_URL" ] && echo "Need to set REPO_URL" && exit 1;
[ -z "$GPG_PASSPHRASE" ] && echo "Need to set GPG_PASSPHRASE" && exit 1;
if [ "$INTERNAL_RELEASE" = true ] ; then
echo "Making internal release"
PROFILE="internal-release"
else
echo "Making public release"
PROFILE="public-release"
fi
# Make release
mvn release:clean
mvn -P $PROFILE release:prepare --batch-mode "-Darguments=-DskipTests -Ddependency-check.skip=true"
mvn -P $PROFILE release:perform "-Darguments=-DskipTests"