blob: 4edd38b269c4841990239ce4d442b511a42bc8f3 [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
Thomas Vachuska7f2a3562018-02-28 10:02:16 -080026# Stage the admin bits tar in /tmp
27rm -f $ONOS_ADMIN_TAR
28cp $(onos-buck build //:onos-admin --show-output | tail -1 | cut -d\ -f2) $ONOS_ADMIN_TAR
29
30
Ray Milkeyb4f1cf02018-01-29 13:54:10 -080031# use this to upload to AWS
32# onosUploadBits.py ${ONOS_VERSION%-*}
33
34# use this to upload to maven central
Ray Milkeyf27ac302018-05-09 13:14:21 -070035if echo $ONOS_VERSION | grep '-b'; then
36 echo "ONOS version $ONOS_VERSION is a beta. Skipping publishing .tar.gz files"
Ray Milkeyb4f1cf02018-01-29 13:54:10 -080037 exit 0
38fi
39UPLOAD_BASE="https://oss.sonatype.org/service/local/staging/deploy/maven2/org/onosproject/onos-releases/$ONOS_VERSION"
40curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_TAR $UPLOAD_BASE/onos-$ONOS_VERSION.tar.gz
41curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_TEST_TAR $UPLOAD_BASE/onos-test-$ONOS_VERSION.tar.gz
Thomas Vachuska7f2a3562018-02-28 10:02:16 -080042curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_ADMIN_TAR $UPLOAD_BASE/onos-admin-$ONOS_VERSION.tar.gz
Ray Milkeyb4f1cf02018-01-29 13:54:10 -080043curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_ZIP $UPLOAD_BASE/onos-$ONOS_VERSION.zip