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 | |
Ray Milkey | ed8fe89 | 2018-01-29 13:54:10 -0800 | [diff] [blame] | 26 | # use this to upload to AWS |
| 27 | # onosUploadBits.py ${ONOS_VERSION%-*} |
| 28 | |
| 29 | # use this to upload to maven central |
| 30 | if echo $ONOS_VERSION | grep '-'; then |
| 31 | echo "ONOS version $ONOS_VERSION is a beta or RC. Skipping publishing .tar.gz files" |
| 32 | exit 0 |
| 33 | fi |
| 34 | UPLOAD_BASE="https://oss.sonatype.org/service/local/staging/deploy/maven2/org/onosproject/onos-releases/$ONOS_VERSION" |
| 35 | curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_TAR $UPLOAD_BASE/onos-$ONOS_VERSION.tar.gz |
| 36 | curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_TEST_TAR $UPLOAD_BASE/onos-test-$ONOS_VERSION.tar.gz |
| 37 | curl -v -u "$SONATYPE_USER:$SONATYPE_PASSWORD" --upload-file $ONOS_ZIP $UPLOAD_BASE/onos-$ONOS_VERSION.zip |