-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use back revision variable in pom.xml So user or CI system can easily override revision from external sources such as Git tag name * Add flatten maven plugin This plugin is useful during deployment so the final pom is resolved without parent dependency, i.e. we do not necessarily need to upload parent library * Increase versions for maven source,javadoc,spotless plugins So it has newer features and more fixes * Add gpg-plugin needed to sign releases * Use oss configure for flatten plugin, add developers info in pom.xml (required for releasing library * Add publish-java-sdk script * Add more logs to publish-java-sdk.sh * Add ProwJob publish-java-sdk * Use GPG_KEY_IMPORT_DIR variable * Update revision in pom.xml to 0.4.2-SNAPSHOT
- Loading branch information
1 parent
3230bf5
commit ec6b26b
Showing
8 changed files
with
202 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 --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 --projects sdk/java -Drevision=$REVISION --batch-mode clean deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters