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"
diff --git a/jjb/onos/onos-release-build.sh b/jjb/onos/onos-release-build.sh
index 44803ce..b195c74 100644
--- a/jjb/onos/onos-release-build.sh
+++ b/jjb/onos/onos-release-build.sh
@@ -36,13 +36,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
@@ -60,3 +53,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"
diff --git a/jjb/onos/onos-verify.yaml b/jjb/onos/onos-verify.yaml
index e0adeab..56615a6 100644
--- a/jjb/onos/onos-verify.yaml
+++ b/jjb/onos/onos-verify.yaml
@@ -32,7 +32,7 @@
           lftools-version: '{lftools-version}'
 
     wrappers:
-      - lf-infra-wrappers:
+      - onf-infra-rsync-wrappers:
           build-timeout: '{build-timeout}'
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
@@ -423,9 +423,6 @@
             - file-id: 'release-build-maven-settings'
               target: 'settings.xml'
               variable: 'MAVEN_SETTINGS'
-            - file-id: 'api-onosproject-ssh-key'
-              target: 'id_rsa.pub'
-              variable: 'API_ONOSPROJECT_SSH_KEY'
 
     #put shell scripts in file then make sure shell check is installed on verify vms
       - shell: !include-raw-escape: onos-yang-tools-release-build.sh
@@ -528,9 +525,6 @@
             - file-id: 'release-build-maven-settings'
               target: 'settings.xml'
               variable: 'MAVEN_SETTINGS'
-            - file-id: 'api-onosproject-ssh-key'
-              target: 'id_rsa.pub'
-              variable: 'API_ONOSPROJECT_SSH_KEY'
 
     #put shell scripts in file then make sure shell check is installed on verify vms
       - shell: !include-raw-escape: onos-release-build.sh