Fix documentation job triggers, split docs into modern/legacy files

Change-Id: I8c749778c170410f52e4c1d87f77bc5ca8226cc0
diff --git a/jjb/docs.yaml b/jjb/docs.yaml
index e3fc165..e59fa44 100644
--- a/jjb/docs.yaml
+++ b/jjb/docs.yaml
@@ -2,82 +2,21 @@
 # CORD documentation verification and publish tasks
 
 - project:
-    name: verify-docs-legacy
-
-    # add repos that have documentation to the project list in both jobs
-    jobs:
-      - 'verify-documentation-legacy':
-          project-regexp: '^.*$'
-          branch-regexp: '{legacy-branches-regexp}'
-
-- project:
     name: verify-docs
 
-    # add repos that have documentation to the project list in both jobs
     jobs:
       - 'verify-documentation':
-          other-docs-repos-regexp: '^.*$'
+          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: '^.*$'
+          other-docs-repos-regexp: '.*'
           branch-regexp: '{modern-branches-regexp}'
 
-# Documentation job templates
-- job-template:
-    id: verify-documentation-legacy
-    name: "verify-documentation-legacy"
-
-    triggers:
-      - cord-infra-gerrit-trigger-patchset:
-          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:
-      - cord-infra-gerrit-repo-patch:
-          destination-dir: 'cord'
-          project: '$GERRIT_PROJECT'
-          change-number: '$GERRIT_CHANGE_NUMBER'
-          patchset-number: '$GERRIT_PATCHSET_NUMBER'
-      - shell: |
-          cd cord/build/docs
-          make test
-
 - job-template:
     id: verify-documentation
     name: "verify-documentation"
@@ -144,67 +83,33 @@
           make test
 
 - job-template:
-    id: publish-documentation-legacy
-    name: 'publish-documentation-legacy'
-
-    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/build/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'
-
-
-- 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}'
+      - gerrit:
+          server-name: '{gerrit-server-name}'
           dependency-jobs: '{dependency-jobs}'
+          silent-start: true
+          trigger-on:
+            - change-merged-event
+          projects:
+            - project-compare-type: PLAIN
+              project-pattern: 'docs'
+              branches:
+                - branch-compare-type: REG_EXP
+                  branch-pattern: '{branch-regexp}'
+              file-paths:
+                - compare-type: REG_EXP
+                  pattern: '{all-files-regexp}'
+            - project-compare-type: REG_EXP
+              project-pattern: '{other-docs-repos-regexp}'
+              branches:
+                - branch-compare-type: REG_EXP
+                  branch-pattern: '{branch-regexp}'
+              file-paths:
+                - compare-type: REG_EXP
+                  pattern: '{doc-files-regexp}'
 
     properties:
       - cord-infra-properties: