Change ONOS API doc publishing to use rsync

Change-Id: I9a799ab7fa4176156737d7a0aac8fcb99daf2fd6
diff --git a/jjb/onos/onos-bazel-release-build.sh b/jjb/onos/onos-bazel-release-build.sh
index 9f43511..82a1d78 100644
--- a/jjb/onos/onos-bazel-release-build.sh
+++ b/jjb/onos/onos-bazel-release-build.sh
@@ -32,13 +32,6 @@
 mkdir -p ~/.m2
 mv settings.xml ~/.m2/settings.xml
 
-# stage and add the build SSH key
-chmod 600 id_rsa.pub
-ssh-add id_rsa.pub
-
-# Add the javadoc server to the list of known hosts
-ssh-keyscan -H -t rsa api.onosproject.org >>~/.ssh/known_hosts
-
 # set user to use for uploading javadocs
 WIKI_USER="jenkins"
 export WIKI_USER
@@ -56,3 +49,11 @@
 
 # run the build
 onos-build-and-upload ${ONOS_VERSION} ${ONOS_NEXT_VERSION} ${GERRIT_BRANCH}
+
+# upload API docs
+BUILD_OUTPUT_PATH=${ONOS_ROOT}/bazel-bin/docs/tmp
+
+SYNC_TARGET_SERVER=static.opennetworking.org
+SYNC_TARGET_PATH=/srv/sites/api.onosproject.org/${ONOS_VERSION}
+
+rsync -rvzh --delete-after --exclude=.git "$BUILD_OUTPUT_PATH" "$SYNC_TARGET_SERVER:$SYNC_TARGET_PATH"