blob: f4983589cb96c3462b3f7202f7f8a062b78ab195 [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}}
Thomas Vachuska683b31b2015-01-26 11:54:31 -080012remote=$user@wiki.onosproject.org
13
14scp $ONOS_ROOT/docs/target/onos-apidocs-$ONOS_VERSION.tar.gz $remote:/tmp
15ssh $remote "
16 mkdir -p /var/www/api/$ONOS_VERSION
17 cd /var/www/api/$ONOS_VERSION
18 tar zxf /tmp/onos-apidocs-$ONOS_VERSION.tar.gz
19 mv onos-apidocs-$ONOS_VERSION/* .
20 rm -rf onos-apidocs-$ONOS_VERSION
21
Brian O'Connorc04e8762016-03-01 19:18:53 -080022 # bump /var/www/api/index.html
23 sed -i -E 's#/[^/]+/#/$ONOS_VERSION/#g' /var/www/api/index.html
Thomas Vachuska683b31b2015-01-26 11:54:31 -080024"