-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathpublish-java-sdk.sh
More file actions
executable file
·72 lines (61 loc) · 2.23 KB
/
publish-java-sdk.sh
File metadata and controls
executable file
·72 lines (61 loc) · 2.23 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
set -e
set -o pipefail
GPG_KEY_IMPORT_DIR=/etc/gpg
usage()
{
echo "usage: publish-java-sdk.sh
--revision Value for the revision e.g. '0.2.3'
--gpg-key-import-dir Directory containing existing GPG keys to import.
The directory should contain these 2 files:
- public-key
- private-key
The default value is '/etc/gpg'
This script assumes the GPG private key is protected by a passphrase.
The passphrase can be specified in \$HOME/.m2/settings.xml. In the same xml
file, credentials to upload releases to Sonatype must also be provided.
# Example settings: ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>ossrh</id>
<username>SONATYPE_USER</username>
<password>SONATYPE_PASSWORD</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<properties>
<gpg.passphrase>GPG_PASSPHRASE</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
"
}
while [ "$1" != "" ]; do
case "$1" in
--revision ) REVISION="$2"; shift;;
--gpg-key-import-dir ) GPG_KEY_IMPORT_DIR="$2"; shift;;
-h | --help ) usage; exit;;
* ) usage; exit 1
esac
shift
done
if [ -z $REVISION ]; then usage; exit 1; fi
echo "============================================================"
echo "Checking Maven and GPG versions"
echo "============================================================"
mvn -f java/pom.xml --version
echo ""
gpg --version
echo "============================================================"
echo "Importing GPG keys"
echo "============================================================"
gpg --import --batch --yes $GPG_KEY_IMPORT_DIR/public-key
gpg --import --batch --yes $GPG_KEY_IMPORT_DIR/private-key
echo "============================================================"
echo "Deploying Java SDK with revision: $REVISION"
echo "============================================================"
mvn -f java/pom.xml --projects .,datatypes,serving-client -Drevision=$REVISION --batch-mode clean deploy