CORD-3035 creating legacy/modern verify+publish documentation jobs

Change-Id: If43e4e32511391613cdd0a3522c2d14808c1a2c5
diff --git a/jjb/defaults.yaml b/jjb/defaults.yaml
index e7d2896..bebda2a 100644
--- a/jjb/defaults.yaml
+++ b/jjb/defaults.yaml
@@ -41,9 +41,12 @@
     # regexp for gerrit triggers
     # list of supported branches, for branch-regexp
     supported-branches-regexp: '^(master|cord-6.0|cord-5.0|cord-4.1|cord-4.0)$'
+    legacy-branches-regexp: '^(cord-5.0|cord-4.1|cord-4.0)$'
     modern-branches-regexp: '^(master|cord-6.0)$'
 
     # for matching files with file-include-regexp
     all-files-regexp: '.*'
-    doc-files-regexp: "^docs/.*"
+    doc-files-regexp: '^docs/.*'
 
+    # Jenkins SSH host doc publisher
+    docs-ssh-host: 'guide.opencord.org'
diff --git a/jjb/docs.yaml b/jjb/docs.yaml
index 17ae369..e3fc165 100644
--- a/jjb/docs.yaml
+++ b/jjb/docs.yaml
@@ -7,8 +7,8 @@
     # add repos that have documentation to the project list in both jobs
     jobs:
       - 'verify-documentation-legacy':
-          project-regexp: '^(cord|platform-install|cord-tester|rcord|ecord|mcord|opencloud|xos|xos-gui|xos-tosca)$'
-          branch-regexp: '{supported-branches-regexp}'
+          project-regexp: '^.*$'
+          branch-regexp: '{legacy-branches-regexp}'
 
 - project:
     name: verify-docs
@@ -16,16 +16,24 @@
     # add repos that have documentation to the project list in both jobs
     jobs:
       - 'verify-documentation':
-          other-docs-repos-regexp: '^(cord-tester|xos|xos-gui|xos-tosca)$'
+          other-docs-repos-regexp: '^.*$'
           branch-regexp: '{modern-branches-regexp}'
 
 - project:
+    name: publish-docs-legacy
+
+    jobs:
+      - 'publish-documentation-legacy':
+          project-regexp: '^.*$'
+          branch-regexp: '{legacy-branches-regexp}'
+
+- project:
     name: publish-docs
 
     jobs:
       - 'publish-documentation':
-          project-regexp: '^(cord|platform-install|cord-tester|rcord|ecord|mcord|opencloud|xos|xos-gui|xos-tosca)$'
-          branch-regexp: '{supported-branches-regexp}'
+          project-regexp: '^.*$'
+          branch-regexp: '{modern-branches-regexp}'
 
 # Documentation job templates
 - job-template:
@@ -136,8 +144,8 @@
           make test
 
 - job-template:
-    id: publish-documentation
-    name: 'publish-documentation'
+    id: publish-documentation-legacy
+    name: 'publish-documentation-legacy'
 
     triggers:
       - cord-infra-gerrit-trigger-merge:
@@ -175,13 +183,63 @@
 # publish over ssh: https://docs.openstack.org/infra/jenkins-job-builder/publishers.html#publishers.ssh
     publishers:
       - ssh:
-          site: 'CORD Wiki'
+          site: '{docs-ssh-host}'
           source: 'cord/build/docs/_book/**'
           remove-prefix: 'cord/build/docs/_book'
           target: '//var/www/guide/$GERRIT_BRANCH'
       - ssh:
-          site: 'CORD Wiki'
+          site: '{docs-ssh-host}'
           source: 'cord/build/docs/xos/swagger/**'
           remove-prefix: 'cord/build/docs/xos'
           target: '//var/www/guide/$GERRIT_BRANCH'
 
+
+- job-template:
+    id: publish-documentation
+    name: 'publish-documentation'
+
+    triggers:
+      - cord-infra-gerrit-trigger-merge:
+          gerrit-server-name: '{gerrit-server-name}'
+          project-regexp: '{project-regexp}'
+          branch-regexp: '{branch-regexp}'
+          file-include-regexp: '{doc-files-regexp}'
+          dependency-jobs: '{dependency-jobs}'
+
+    properties:
+      - cord-infra-properties:
+          build-days-to-keep: '{build-days-to-keep}'
+          artifact-num-to-keep: '{artifact-num-to-keep}'
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    scm:
+      - cord-infra-gerrit-repo-scm:
+          manifest-url: '{gerrit-server-url}/{cord-repo-manifest}'
+          branch: '$GERRIT_BRANCH'
+          destination-dir: 'cord'
+
+    node: '{build-node}'
+    project-type: freestyle
+    concurrent: false
+
+    builders:
+      - shell: |
+          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'
diff --git a/jjb/helm.yaml b/jjb/helm.yaml
index dbb08e3..c6af00d 100644
--- a/jjb/helm.yaml
+++ b/jjb/helm.yaml
@@ -57,7 +57,7 @@
 # publish over ssh: https://docs.openstack.org/infra/jenkins-job-builder/publishers.html#publishers.ssh
     publishers:
       - ssh:
-          site: 'CORD Wiki'
+          site: '{docs-ssh-host}'
           source: 'chart_repo/**'
           remove-prefix: 'chart_repo'
           target: '//var/www/guide/charts/$GERRIT_BRANCH'