blob: 97df2e5cfa97d6dbf4602e4fd5c78cd364a7d6e8 [file] [log] [blame]
#!/bin/bash
# -----------------------------------------------------------------------------
# Builds and uploads an ONOS buck plugin release
# -----------------------------------------------------------------------------
if [ $# -ne 1 ]; then
echo "Usage: push-buck-plugin version"
exit 1
fi
PLUGIN_VERSION="$1"
PLUGIN_FILE="buck-out/gen/tools/build/buck-plugin/onos.jar"
UPLOAD_BASE="https://oss.sonatype.org/service/local/staging/deploy/maven2/org/onosproject/onos-buck-plugin/$PLUGIN_VERSION"
# Build the buck plugin
onos-buck build //tools/build/buck-plugin:onos
# Make the signature file
gpg --armor --detach-sig $PLUGIN_FILE
# Make the MD5 checksum file
md5 -q $PLUGIN_FILE >$PLUGIN_FILE.md5
# Make the SHA1 checksum file
( shasum $PLUGIN_FILE | cut -d' ' -f1 ) > $PLUGIN_FILE.sha1
curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE $UPLOAD_BASE/onos-buck-plugin-$PLUGIN_VERSION.jar
curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.asc $UPLOAD_BASE/onos-buck-plugin-$PLUGIN_VERSION.jar.asc
curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.md5 $UPLOAD_BASE/onos-buck-plugin-$PLUGIN_VERSION.jar.md5
curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.sha1 $UPLOAD_BASE/onos-buck-plugin-$PLUGIN_VERSION.jar.sha1