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