Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Uploads ONOS distributable bits. |
| 4 | # ----------------------------------------------------------------------------- |
Brian O'Connor | f5d9363 | 2015-09-04 20:18:31 -0700 | [diff] [blame] | 5 | |
| 6 | set -e |
| 7 | |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 8 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 9 | . $ONOS_ROOT/tools/build/envDefaults |
| 10 | |
Thomas Vachuska | be1a196 | 2016-10-25 16:59:29 -0700 | [diff] [blame] | 11 | # Stage the onos tar in /tmp |
| 12 | rm -f $ONOS_TAR |
| 13 | cp $(onos-buck build onos --show-output | tail -1 | cut -d\ -f2) $ONOS_TAR |
| 14 | |
| 15 | # Repackage the onos tar |
| 16 | pushd /tmp/ |
| 17 | tar xf onos-$ONOS_VERSION.tar.gz |
| 18 | rm -f onos-$ONOS_VERSION.zip |
| 19 | zip -r onos-$ONOS_VERSION.zip onos-$ONOS_VERSION/ |
| 20 | popd |
| 21 | |
| 22 | # Stage the test bits tar in /tmp |
| 23 | rm -f $ONOS_TEST_TAR |
| 24 | cp $(onos-buck build //:onos-test --show-output | tail -1 | cut -d\ -f2) $ONOS_TEST_TAR |
| 25 | |
Thomas Vachuska | 7f2a356 | 2018-02-28 10:02:16 -0800 | [diff] [blame^] | 26 | # Stage the admin bits tar in /tmp |
| 27 | rm -f $ONOS_ADMIN_TAR |
| 28 | cp $(onos-buck build //:onos-admin --show-output | tail -1 | cut -d\ -f2) $ONOS_ADMIN_TAR |
| 29 | |
| 30 | |
Ray Milkey | b4f1cf0 | 2018-01-29 13:54:10 -0800 | [diff] [blame] | 31 | # use this to upload to AWS |
| 32 | # onosUploadBits.py ${ONOS_VERSION%-*} |
| 33 | |
| 34 | # use this to upload to maven central |
| 35 | if echo $ONOS_VERSION | grep '-'; then |
| 36 | echo "ONOS version $ONOS_VERSION is a beta or RC. Skipping publishing .tar.gz files" |
| 37 | exit 0 |
| 38 | fi |
| 39 | UPLOAD_BASE="https://oss.sonatype.org/service/local/staging/deploy/maven2/org/onosproject/onos-releases/$ONOS_VERSION" |
| 40 | curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_TAR $UPLOAD_BASE/onos-$ONOS_VERSION.tar.gz |
| 41 | curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_TEST_TAR $UPLOAD_BASE/onos-test-$ONOS_VERSION.tar.gz |
Thomas Vachuska | 7f2a356 | 2018-02-28 10:02:16 -0800 | [diff] [blame^] | 42 | curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_ADMIN_TAR $UPLOAD_BASE/onos-admin-$ONOS_VERSION.tar.gz |
Ray Milkey | b4f1cf0 | 2018-01-29 13:54:10 -0800 | [diff] [blame] | 43 | curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_ZIP $UPLOAD_BASE/onos-$ONOS_VERSION.zip |