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 | |
Brian O'Connor | a317872 | 2016-03-10 15:44:27 -0800 | [diff] [blame] | 11 | user=${1:-${WIKI_USER:-$USER}} |
Ray Milkey | c9c1848 | 2017-09-05 19:41:15 -0700 | [diff] [blame] | 12 | remote=$user@api.onosproject.org |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 13 | |
Brian O'Connor | 1b6ae59 | 2016-10-25 00:45:00 -0700 | [diff] [blame] | 14 | docs=$(onos-buck build //docs:external --show-output 2>/dev/null | tail -1 | cut -d\ -f2) |
| 15 | |
| 16 | scp $docs $remote:/tmp/onos-apidocs-$ONOS_VERSION.tar.gz |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 17 | ssh $remote " |
| 18 | mkdir -p /var/www/api/$ONOS_VERSION |
| 19 | cd /var/www/api/$ONOS_VERSION |
Brian O'Connor | 1b6ae59 | 2016-10-25 00:45:00 -0700 | [diff] [blame] | 20 | unzip /tmp/onos-apidocs-$ONOS_VERSION.tar.gz |
| 21 | #mv onos-apidocs-$ONOS_VERSION/* . |
| 22 | #rm -rf onos-apidocs-$ONOS_VERSION |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 23 | |
Brian O'Connor | c04e876 | 2016-03-01 19:18:53 -0800 | [diff] [blame] | 24 | # bump /var/www/api/index.html |
| 25 | sed -i -E 's#/[^/]+/#/$ONOS_VERSION/#g' /var/www/api/index.html |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 26 | " |