blob: 0e4320c10cfcbd7754d407089e5d2ac91ad4a2f3 [file] [log] [blame]
#!/bin/bash
# -----------------------------------------------------------------------------
# Uploads ONOS Java API docs.
# -----------------------------------------------------------------------------
set -e
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
user=${1:-${WIKI_USER:-$USER}}
remote=$user@api.onosproject.org
docs="bazel-bin/docs/external.jar"
ONOS_VERSION_STRING=$ONOS_VERSION
if echo $ONOS_VERSION_STRING | grep -- '-b'; then
echo "ONOS version $ONOS_VERSION_STRING is a beta. Skipping"
exit 0
fi
scp $docs $remote:/tmp/onos-apidocs-$ONOS_VERSION.tar.gz
ssh $remote "
mkdir -p /var/www/api/$ONOS_VERSION
cd /var/www/api/$ONOS_VERSION
unzip /tmp/onos-apidocs-$ONOS_VERSION.tar.gz
"