blob: 0e4320c10cfcbd7754d407089e5d2ac91ad4a2f3 [file] [log] [blame]
Thomas Vachuska683b31b2015-01-26 11:54:31 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Uploads ONOS Java API docs.
4# -----------------------------------------------------------------------------
5
Brian O'Connorf5d93632015-09-04 20:18:31 -07006set -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
Brian O'Connora3178722016-03-10 15:44:27 -080011user=${1:-${WIKI_USER:-$USER}}
Ray Milkey46b3e852017-09-05 19:41:15 -070012remote=$user@api.onosproject.org
Thomas Vachuska683b31b2015-01-26 11:54:31 -080013
Ray Milkeyf77ea412018-08-10 17:37:28 -070014docs="bazel-bin/docs/external.jar"
Brian O'Connor1b6ae592016-10-25 00:45:00 -070015
Ray Milkey75ee45e2018-01-19 14:08:20 -080016ONOS_VERSION_STRING=$ONOS_VERSION
Ray Milkeyf77ea412018-08-10 17:37:28 -070017if echo $ONOS_VERSION_STRING | grep -- '-b'; then
Ray Milkeyf27ac302018-05-09 13:14:21 -070018 echo "ONOS version $ONOS_VERSION_STRING is a beta. Skipping"
Ray Milkey75ee45e2018-01-19 14:08:20 -080019 exit 0
20fi
21
Brian O'Connor1b6ae592016-10-25 00:45:00 -070022scp $docs $remote:/tmp/onos-apidocs-$ONOS_VERSION.tar.gz
Thomas Vachuska683b31b2015-01-26 11:54:31 -080023ssh $remote "
24 mkdir -p /var/www/api/$ONOS_VERSION
25 cd /var/www/api/$ONOS_VERSION
Brian O'Connor1b6ae592016-10-25 00:45:00 -070026 unzip /tmp/onos-apidocs-$ONOS_VERSION.tar.gz
Thomas Vachuska683b31b2015-01-26 11:54:31 -080027"