summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/tools/build/onos-upload-docs
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/tools/build/onos-upload-docs')
-rwxr-xr-xframework/src/onos/tools/build/onos-upload-docs23
1 files changed, 23 insertions, 0 deletions
diff --git a/framework/src/onos/tools/build/onos-upload-docs b/framework/src/onos/tools/build/onos-upload-docs
new file mode 100755
index 00000000..f74a13ff
--- /dev/null
+++ b/framework/src/onos/tools/build/onos-upload-docs
@@ -0,0 +1,23 @@
+#!/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:-jenkins}
+remote=$user@wiki.onosproject.org
+
+scp $ONOS_ROOT/docs/target/onos-apidocs-$ONOS_VERSION.tar.gz $remote:/tmp
+ssh $remote "
+ mkdir -p /var/www/api/$ONOS_VERSION
+ cd /var/www/api/$ONOS_VERSION
+ tar zxf /tmp/onos-apidocs-$ONOS_VERSION.tar.gz
+ mv onos-apidocs-$ONOS_VERSION/* .
+ rm -rf onos-apidocs-$ONOS_VERSION
+
+ # TODO: optionally bump /var/www/api/index.html
+"