blob: 18985e815e61f8cfdb1c3fb60e7eff342296ccd0 [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
Thomas Vachuska4702a262016-03-02 15:31:52 -080011user=${1:-$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"