blob: 97df2e5cfa97d6dbf4602e4fd5c78cd364a7d6e8 [file] [log] [blame]
Ray Milkeyd8e0f792018-02-22 08:50:07 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Builds and uploads an ONOS buck plugin release
4# -----------------------------------------------------------------------------
5
6if [ $# -ne 1 ]; then
7 echo "Usage: push-buck-plugin version"
8 exit 1
9fi
10
11PLUGIN_VERSION="$1"
12PLUGIN_FILE="buck-out/gen/tools/build/buck-plugin/onos.jar"
13UPLOAD_BASE="https://oss.sonatype.org/service/local/staging/deploy/maven2/org/onosproject/onos-buck-plugin/$PLUGIN_VERSION"
14
15# Build the buck plugin
16onos-buck build //tools/build/buck-plugin:onos
17
18# Make the signature file
19gpg --armor --detach-sig $PLUGIN_FILE
20
21# Make the MD5 checksum file
22md5 -q $PLUGIN_FILE >$PLUGIN_FILE.md5
23
24# Make the SHA1 checksum file
25( shasum $PLUGIN_FILE | cut -d' ' -f1 ) > $PLUGIN_FILE.sha1
26
27curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE $UPLOAD_BASE/onos-buck-plugin-$PLUGIN_VERSION.jar
28curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.asc $UPLOAD_BASE/onos-buck-plugin-$PLUGIN_VERSION.jar.asc
29curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.md5 $UPLOAD_BASE/onos-buck-plugin-$PLUGIN_VERSION.jar.md5
30curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $PLUGIN_FILE.sha1 $UPLOAD_BASE/onos-buck-plugin-$PLUGIN_VERSION.jar.sha1
31