blob: 79986b663e629bcb53a3a83f25c793991cbae052 [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 Milkeyc9c18482017-09-05 19:41:15 -070012remote=$user@api.onosproject.org
Thomas Vachuska683b31b2015-01-26 11:54:31 -080013
Brian O'Connor1b6ae592016-10-25 00:45:00 -070014docs=$(onos-buck build //docs:external --show-output 2>/dev/null | tail -1 | cut -d\ -f2)
15
16scp $docs $remote:/tmp/onos-apidocs-$ONOS_VERSION.tar.gz
Thomas Vachuska683b31b2015-01-26 11:54:31 -080017ssh $remote "
18 mkdir -p /var/www/api/$ONOS_VERSION
19 cd /var/www/api/$ONOS_VERSION
Brian O'Connor1b6ae592016-10-25 00:45:00 -070020 unzip /tmp/onos-apidocs-$ONOS_VERSION.tar.gz
21 #mv onos-apidocs-$ONOS_VERSION/* .
22 #rm -rf onos-apidocs-$ONOS_VERSION
Thomas Vachuska683b31b2015-01-26 11:54:31 -080023
Brian O'Connorc04e8762016-03-01 19:18:53 -080024 # bump /var/www/api/index.html
25 sed -i -E 's#/[^/]+/#/$ONOS_VERSION/#g' /var/www/api/index.html
Thomas Vachuska683b31b2015-01-26 11:54:31 -080026"