blob: d74deb8c551da718b02e8713a4584251933ecb75 [file] [log] [blame]
Thomas Vachuska683b31b2015-01-26 11:54:31 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Uploads ONOS distributable bits.
4# -----------------------------------------------------------------------------
Brian O'Connorf5d93632015-09-04 20:18:31 -07005
6set -e
7
Thomas Vachuska683b31b2015-01-26 11:54:31 -08008[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
9. $ONOS_ROOT/tools/build/envDefaults
10
Thomas Vachuskabe1a1962016-10-25 16:59:29 -070011# Stage the onos tar in /tmp
12rm -f $ONOS_TAR
13cp $(onos-buck build onos --show-output | tail -1 | cut -d\ -f2) $ONOS_TAR
14
15# Repackage the onos tar
16pushd /tmp/
17tar xf onos-$ONOS_VERSION.tar.gz
18rm -f onos-$ONOS_VERSION.zip
19zip -r onos-$ONOS_VERSION.zip onos-$ONOS_VERSION/
20popd
21
22# Stage the test bits tar in /tmp
23rm -f $ONOS_TEST_TAR
24cp $(onos-buck build //:onos-test --show-output | tail -1 | cut -d\ -f2) $ONOS_TEST_TAR
25
Ray Milkeyb4f1cf02018-01-29 13:54:10 -080026# use this to upload to AWS
27# onosUploadBits.py ${ONOS_VERSION%-*}
28
29# use this to upload to maven central
30if echo $ONOS_VERSION | grep '-'; then
31 echo "ONOS version $ONOS_VERSION is a beta or RC. Skipping publishing .tar.gz files"
32 exit 0
33fi
34UPLOAD_BASE="https://oss.sonatype.org/service/local/staging/deploy/maven2/org/onosproject/onos-releases/$ONOS_VERSION"
35curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_TAR $UPLOAD_BASE/onos-$ONOS_VERSION.tar.gz
36curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_TEST_TAR $UPLOAD_BASE/onos-test-$ONOS_VERSION.tar.gz
37curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_ZIP $UPLOAD_BASE/onos-$ONOS_VERSION.zip