Merge "adding flex-pod1(olt/onu) build-test job"
diff --git a/Makefile b/Makefile
index 74377f4..c096b44 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 .PHONY: test clean
 
 VENV_DIR      ?= venv-jjb
-JJB_VERSION   ?= 2.0.3
+JJB_VERSION   ?= 2.0.5
 JOBCONFIG_DIR ?= job-configs
 
 $(VENV_DIR):
@@ -20,7 +20,7 @@
 test: $(VENV_DIR) $(JOBCONFIG_DIR)
 	source $(VENV_DIR)/bin/activate ; \
 	pipdeptree ; \
-	jenkins-jobs -l DEBUG test --recursive -o $(JOBCONFIG_DIR) jjb/ ;
+	jenkins-jobs -l DEBUG test --recursive --config-xml -o $(JOBCONFIG_DIR) jjb/ ;
 
 clean:
 	rm -rf $(VENV_DIR) $(JOBCONFIG_DIR)
diff --git a/jjb/charts.yaml b/jjb/charts.yaml
index ce2fd37..63444cd 100644
--- a/jjb/charts.yaml
+++ b/jjb/charts.yaml
@@ -50,15 +50,17 @@
 
     builders:
       - shell: |
+          #!/usr/bin/env bash
+
+          # Set up the ssh host keys for the docs host
+          mkdir -p ~/.ssh
+          echo '{docs-ssh-host-key}' >> ~/.ssh/known_hosts
+
+          # Setup and build the helm repo
           helm init --client-only
           helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
           ./scripts/helmrepo.sh
 
-# publish over ssh: https://docs.openstack.org/infra/jenkins-job-builder/publishers.html#publishers.ssh
-    publishers:
-      - ssh:
-          site: '{docs-ssh-host}'
-          source: 'chart_repo/**'
-          remove-prefix: 'chart_repo'
-          target: '//var/www/charts/$GERRIT_BRANCH'
+          # Copy repo to host
+          rsync -rvzh --delete chart_repo/ {docs-ssh-host}:/var/www/charts/$GERRIT_BRANCH
 
diff --git a/jjb/ci-management/ci-management.yaml b/jjb/ci-management/ci-management.yaml
index f0357ad..0495467 100644
--- a/jjb/ci-management/ci-management.yaml
+++ b/jjb/ci-management/ci-management.yaml
@@ -18,4 +18,4 @@
     project: 'ci-management'
     project-name: 'ci-management'
 
-    jjb-version: 2.0.3
+    jjb-version: 2.0.5
diff --git a/jjb/cord-test/rcord-lite.yaml b/jjb/cord-test/rcord-lite.yaml
index 6ff684b..f1b3a50 100644
--- a/jjb/cord-test/rcord-lite.yaml
+++ b/jjb/cord-test/rcord-lite.yaml
@@ -15,7 +15,7 @@
          kube-pod: 'flex-onf-pod1'
          profile: 'rcord-lite'
          branch: 'master'
-         Jenkinsfile: 'Jenkinsfile.rcordlite'
+         Jenkinsfile: 'Jenkinsfile-rcordlite'
          time: '20'
       
      # flex pod1 with olt/onu  kubernetes build jobs (rcord lite)
diff --git a/jjb/defaults.yaml b/jjb/defaults.yaml
index bebda2a..294050b 100644
--- a/jjb/defaults.yaml
+++ b/jjb/defaults.yaml
@@ -50,3 +50,5 @@
 
     # Jenkins SSH host doc publisher
     docs-ssh-host: 'guide.opencord.org'
+    docs-ssh-host-key: 'guide.opencord.org,52.9.82.207 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFHwOY3/8GucdKzBngH/FC08nHac/RJ/OheZp2+5EpOPXZG9zQW2YUbXH5A9pO76lI5CG3z3+huG62xEGo99UQU='
+
diff --git a/jjb/docs-legacy.yaml b/jjb/docs-legacy.yaml
index 69dcafa..1151e17 100644
--- a/jjb/docs-legacy.yaml
+++ b/jjb/docs-legacy.yaml
@@ -93,18 +93,17 @@
 
     builders:
       - shell: |
-          cd cord/build/docs
+          #!/usr/bin/env bash
+
+          # Set up the ssh host keys for the docs host
+          mkdir -p ~/.ssh
+          echo '{docs-ssh-host-key}' >> ~/.ssh/known_hosts
+
+          # build the docs
+          cd cord/docs
           make build
 
-# publish over ssh: https://docs.openstack.org/infra/jenkins-job-builder/publishers.html#publishers.ssh
-    publishers:
-      - ssh:
-          site: '{docs-ssh-host}'
-          source: 'cord/build/docs/_book/**'
-          remove-prefix: 'cord/build/docs/_book'
-          target: '//var/www/guide/$GERRIT_BRANCH'
-      - ssh:
-          site: '{docs-ssh-host}'
-          source: 'cord/build/docs/xos/swagger/**'
-          remove-prefix: 'cord/build/docs/xos'
-          target: '//var/www/guide/$GERRIT_BRANCH'
+          # copy swagger REST API docs first, then exclude deleting them when copying rest of guide
+          rsync -rvzh --delete _book/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH
+          rsync -rvzh --delete xos/swagger/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH/swagger
+
diff --git a/jjb/docs.yaml b/jjb/docs.yaml
index aec942f..c7a0332 100644
--- a/jjb/docs.yaml
+++ b/jjb/docs.yaml
@@ -51,7 +51,6 @@
               file-paths:
                 - compare-type: REG_EXP
                   pattern: '{doc-files-regexp}'
-              file-paths:
                 - compare-type: REG_EXP
                   pattern: '.*\.md'
 
@@ -113,6 +112,8 @@
               file-paths:
                 - compare-type: REG_EXP
                   pattern: '{doc-files-regexp}'
+                - compare-type: REG_EXP
+                  pattern: '.*\.md'
 
     properties:
       - cord-infra-properties:
@@ -136,18 +137,17 @@
 
     builders:
       - shell: |
+          #!/usr/bin/env bash
+
+          # Set up the ssh host keys for the docs host
+          mkdir -p ~/.ssh
+          echo '{docs-ssh-host-key}' >> ~/.ssh/known_hosts
+
+          # build the docs
           cd cord/docs
           make build
 
-# publish over ssh: https://docs.openstack.org/infra/jenkins-job-builder/publishers.html#publishers.ssh
-    publishers:
-      - ssh:
-          site: '{docs-ssh-host}'
-          source: 'cord/docs/_book/**'
-          remove-prefix: 'cord/docs/_book'
-          target: '//var/www/guide/$GERRIT_BRANCH'
-      - ssh:
-          site: '{docs-ssh-host}'
-          source: 'cord/docs/xos/swagger/**'
-          remove-prefix: 'cord/docs/xos'
-          target: '//var/www/guide/$GERRIT_BRANCH'
+          # copy swagger REST API docs first, then exclude deleting them when copying rest of guide
+          rsync -rvzh --delete _book/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH
+          rsync -rvzh --delete xos/swagger/ {docs-ssh-host}:/var/www/guide/$GERRIT_BRANCH/swagger
+
diff --git a/jjb/global-jjb b/jjb/global-jjb
index ad0ee7c..d1b7f48 160000
--- a/jjb/global-jjb
+++ b/jjb/global-jjb
@@ -1 +1 @@
-Subproject commit ad0ee7c792b24345f2b419b3418bd84eac0f6ac1
+Subproject commit d1b7f48bb76729ddde974357b4de845db71bb5a8
diff --git a/jjb/pipeline/all-xos-api-test-helm.groovy b/jjb/pipeline/all-xos-api-test-helm.groovy
index f53e527..1aa5a42 100644
--- a/jjb/pipeline/all-xos-api-test-helm.groovy
+++ b/jjb/pipeline/all-xos-api-test-helm.groovy
@@ -107,7 +107,7 @@
            pushd cord/helm-charts
            helm dep up xos-core
            helm install -f examples/api-test-values.yaml xos-core -n xos-core
-           sleep 60
+           sleep 300
            helm status xos-core
            if [[ "$GERRIT_PROJECT" =~ ^(rcord|vrouter|vsg|vtn|vtr|fabric|openstack|chameleon|exampleservice|simpleexampleservice|onos-service|olt-service|kubernetes-service)\$ ]]; then
                helm dep update xos-profiles/rcord-lite
diff --git a/jjb/shell/licensecheck.sh b/jjb/shell/licensecheck.sh
index e40802a..d0b2347 100755
--- a/jjb/shell/licensecheck.sh
+++ b/jjb/shell/licensecheck.sh
@@ -31,6 +31,7 @@
   ! -name "*.curl" \
   ! -name "*.db" \
   ! -name "*.der" \
+  ! -name "*.desc" \
   ! -name "*.diff" \
   ! -name "*.dnsmasq" \
   ! -name "*.do" \
diff --git a/jjb/verify/mcord.yaml b/jjb/verify/mcord.yaml
index 7880b20..bc0e3fc 100644
--- a/jjb/verify/mcord.yaml
+++ b/jjb/verify/mcord.yaml
@@ -17,6 +17,3 @@
           dependency-jobs: 'verify_mcord_licensed'
       - 'verify-sonarqube':
           dependency-jobs: 'verify_mcord_ansible-lint'
-      - 'api-test':
-          dependency-jobs: 'verify_mcord_sonarqube'
-          pipeline_script: 'all-xos-api-test.groovy'
diff --git a/jjb/verify/openstack.yaml b/jjb/verify/openstack.yaml
index 9533f4b..98eac1a 100644
--- a/jjb/verify/openstack.yaml
+++ b/jjb/verify/openstack.yaml
@@ -15,6 +15,8 @@
       - 'verify-licensed'
       - 'verify-sonarqube':
           dependency-jobs: 'verify_openstack_licensed'
-      - 'api-test':
+      - 'xos-unit-test':
           dependency-jobs: 'verify_openstack_sonarqube'
+      - 'api-test':
+          dependency-jobs: 'verify_openstack_unit-test'
           pipeline_script: 'all-xos-api-test-helm.groovy'
diff --git a/jjb/xos-tosca-unit.yaml b/jjb/xos-tosca-unit.yaml
index 8b6f601..17c21c4 100644
--- a/jjb/xos-tosca-unit.yaml
+++ b/jjb/xos-tosca-unit.yaml
@@ -62,13 +62,19 @@
           pip install networkx==1.11
           pip install netaddr==0.7.19
           pip install ipaddress==1.0.19
+          pip install grpcio==1.9.1
+          pip install grpcio-tools==1.9.1
+          pip install nose
+          pip install tosca-parser==0.9.0
           echo "Requirements Installed"
 
           cd $BASEDIR/cord/orchestration/xos/lib/xos-util; python setup.py install; echo "xos-util Installed"
           cd $BASEDIR/cord/orchestration/xos/lib/xos-config; python setup.py install; echo "xos-config Installed"
           cd $BASEDIR/cord/orchestration/xos/lib/xos-genx; python setup.py install; echo "xos-genx Installed"
 
-          cp -R $BASEDIR/cord/component/chameleon $BASEDIR/cord/orchestration/xos/xos/xos_client/xosapi/chameleon
+          cd $BASEDIR/cord/orchestration/xos/xos/xos_client/xosapi; ln -s ../../../../../component/chameleon chameleon
+          cd $BASEDIR/cord/orchestration/xos/xos/xos_client; make; echo "xos-client Installed"
+
           cd $BASEDIR/cord/orchestration/xos/xos/xos_client/xosapi/chameleon/protos; VOLTHA_BASE=anything make
           cd $BASEDIR/cord/orchestration/xos/xos/xos_client; python setup.py install
           chmod 777 $BASEDIR/venv-xos/lib/python2.7/site-packages/xosapi/chameleon/protoc_plugins/gw_gen.py
diff --git a/jjb/xos-unit.yaml b/jjb/xos-unit.yaml
index 6d16939..74400e4 100644
--- a/jjb/xos-unit.yaml
+++ b/jjb/xos-unit.yaml
@@ -64,6 +64,7 @@
           pip install ipaddress==1.0.19
           pip install grpcio==1.9.1
           pip install grpcio-tools==1.9.1
+          pip install kafka==1.3.5
           echo "Requirements Installed"
 
           cd $BASEDIR/cord/orchestration/xos/lib/xos-util; python setup.py install; echo "xos-util Installed"