Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Uploads ONOS Java API docs. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
Brian O'Connor | f5d9363 | 2015-09-04 20:18:31 -0700 | [diff] [blame] | 6 | set -e |
| 7 | |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 8 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 9 | . $ONOS_ROOT/tools/build/envDefaults |
| 10 | |
Thomas Vachuska | 4702a26 | 2016-03-02 15:31:52 -0800 | [diff] [blame] | 11 | user=${1:-$USER} |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 12 | remote=$user@wiki.onosproject.org |
| 13 | |
| 14 | scp $ONOS_ROOT/docs/target/onos-apidocs-$ONOS_VERSION.tar.gz $remote:/tmp |
| 15 | ssh $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'Connor | c04e876 | 2016-03-01 19:18:53 -0800 | [diff] [blame] | 22 | # bump /var/www/api/index.html |
| 23 | sed -i -E 's#/[^/]+/#/$ONOS_VERSION/#g' /var/www/api/index.html |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 24 | " |