Add jenkins jobs
diff --git a/jenkins/client/job/opencontrail/build/dpdk-extra.yml b/jenkins/client/job/opencontrail/build/dpdk-extra.yml
new file mode 100644
index 0000000..3f83a25
--- /dev/null
+++ b/jenkins/client/job/opencontrail/build/dpdk-extra.yml
@@ -0,0 +1,77 @@
+classes:
+  - system_extra.jenkins.client.job.common
+parameters:
+  jenkins:
+    client:
+      job_template:
+        build-opencontrail-dpdk-extra:
+          name: build-opencontrail-dpdk-extra-{{branch_name}}-{{os}}-{{dist}}
+          jobs:
+            - os: ubuntu
+              dist: trusty
+              branch_name: kilo
+              branch_real_name: kilo
+            - os: ubuntu
+              dist: trusty
+              branch_name: liberty
+              branch_real_name: liberty-multiqueue
+            - os: ubuntu
+              dist: trusty
+              branch_name: mitaka
+              branch_real_name: mitaka
+            - os: ubuntu
+              dist: xenial
+              branch_name: mitaka
+              branch_real_name: mitaka
+          template:
+            discard:
+             build:
+               keep_num: 5
+             artifact:
+               keep_num: 5
+            type: workflow-scm
+            concurrent: false
+            scm:
+              type: git
+              url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+              credentials: "gerrit"
+              script: build-extra-dpdk-pipeline.groovy
+            quiet_period: 120
+            trigger:
+              gerrit:
+                project:
+                  contrail/contrail-dpdk-extra-packages:
+                    branches:
+                      - "{{branch_real_name}}"
+                message:
+                  build_successful: "Build successful"
+                  build_unstable: "Build unstable"
+                  build_failure: "Build failed"
+                event:
+                  ref:
+                    - updated
+            param:
+              SOURCE_URL:
+                type: string
+                default: "${_param:jenkins_gerrit_url}/contrail/contrail-dpdk-extra-packages.git"
+              SOURCE_BRANCH:
+                type: string
+                default: "{{branch_real_name}}"
+              SOURCE_CREDENTIALS:
+                type: string
+                default: "gerrit"
+              APTLY_URL:
+                type: string
+                default: "${_param:jenkins_aptly_api_url}"
+              APTLY_REPO:
+                type: string
+                default: "{{os}}-{{dist}}-{{branch_name}}"
+              OS:
+                type: string
+                default: "{{os}}"
+              DIST:
+                type: string
+                default: "{{dist}}"
+              ARCH:
+                type: string
+                default: "amd64"
diff --git a/jenkins/client/job/opencontrail/build/generic.yml b/jenkins/client/job/opencontrail/build/generic.yml
new file mode 100644
index 0000000..5bf7e5d
--- /dev/null
+++ b/jenkins/client/job/opencontrail/build/generic.yml
@@ -0,0 +1,162 @@
+classes:
+  - system_extra.jenkins.client.job.common
+parameters:
+  jenkins:
+    client:
+      job_template:
+        build-opencontrail:
+          name: build-opencontrail-{{buildname}}-{{os}}-{{dist}}
+          jobs:
+            - buildname: oc303
+              os: ubuntu
+              dist: trusty
+              branch: R3.0.3.x
+              ppa: mirantis/opencontrail-3.0.3
+              upload_source_package: false
+            - buildname: oc31
+              os: ubuntu
+              dist: trusty
+              branch: R3.1
+              ppa: mirantis/opencontrail-3.1
+              upload_source_package: true
+            - buildname: oc31
+              os: ubuntu
+              dist: xenial
+              branch: R3.1
+              ppa: mirantis/opencontrail-3.1
+              upload_source_package: true
+            - buildname: oc311
+              os: ubuntu
+              dist: trusty
+              branch: R3.1.1.x
+              ppa: irantis/mopencontrail-3.1.1
+              upload_source_package: true
+            - buildname: oc311
+              os: ubuntu
+              dist: xenial
+              branch: R3.1.1.x
+              ppa: mirantis/opencontrail-3.1.1
+              upload_source_package: true
+            - buildname: oc32
+              os: ubuntu
+              dist: trusty
+              branch: R3.2
+              ppa: mirantis/opencontrail-3.2
+              upload_source_package: true
+            - buildname: oc32
+              os: ubuntu
+              dist: xenial
+              branch: R3.2
+              ppa: mirantis/opencontrail-3.2
+              upload_source_package: true
+          template:
+            discard:
+             build:
+               keep_num: 5
+             artifact:
+               keep_num: 5
+            type: workflow-scm
+            concurrent: false
+            quiet_period: 120
+            scm:
+              type: git
+              url: "${_param:jenkins_contrail_pipeline}"
+              credentials: "gerrit"
+              github:
+                url: https://github.com/Mirantis/ccp-contrail-pipeline
+            trigger:
+              gerrit:
+                project:
+                  contrail/contrail-pipeline:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-build:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-controller:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-vrouter:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-third-party:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-generateDS:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-sandesh:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-packages:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-nova-vif-driver:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-neutron-plugin:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-nova-extensions:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-heat:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-web-storage:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-web-server-manager:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-web-controller:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-web-core:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-webui-third-party:
+                    branches:
+                      - "{{branch}}"
+                message:
+                  build_successful: "Build successful"
+                  build_unstable: "Build unstable"
+                  build_failure: "Build failed"
+                event:
+                  ref:
+                    - updated
+            param:
+              APTLY_URL:
+                type: string
+                default: "${_param:jenkins_aptly_api_url}"
+              APTLY_REPO:
+                type: string
+                default: "{{os}}-{{dist}}-{{buildname}}"
+              SOURCE_URL:
+                type: string
+                default: "${_param:jenkins_gerrit_url}/contrail"
+              SOURCE_BRANCH:
+                type: string
+                default: "{{branch}}"
+              SOURCE_CREDENTIALS:
+                type: string
+                default: "gerrit"
+              KEEP_REPOS:
+                type: boolean
+                default: 'false'
+                description: "Don't cleanup on failure"
+              OS:
+                type: string
+                default: "{{os}}"
+              DIST:
+                type: string
+                default: "{{dist}}"
+              ARCH:
+                type: string
+                default: "amd64"
+              PPA:
+                type: string
+                default: "{{ppa}}"
+              UPLOAD_SOURCE_PACKAGE:
+                type: boolean
+                default: '{{upload_source_package}}'
diff --git a/jenkins/client/job/opencontrail/build/init.yml b/jenkins/client/job/opencontrail/build/init.yml
new file mode 100644
index 0000000..9ca87f5
--- /dev/null
+++ b/jenkins/client/job/opencontrail/build/init.yml
@@ -0,0 +1,3 @@
+classes:
+  - system_extra.jenkins.client.job.opencontrail.build.generic
+  - system_extra.jenkins.client.job.opencontrail.build.dpdk-extra
diff --git a/jenkins/client/job/opencontrail/git-mirrors/2way.yml b/jenkins/client/job/opencontrail/git-mirrors/2way.yml
new file mode 100644
index 0000000..2d9a4b3
--- /dev/null
+++ b/jenkins/client/job/opencontrail/git-mirrors/2way.yml
@@ -0,0 +1,33 @@
+classes:
+  - system_extra.jenkins.client.job.common
+parameters:
+  jenkins:
+    client:
+      job:
+        git-mirror-2way-contrail-kubernetes:
+          type: workflow-scm
+          concurrent: false
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+            credentials: "gerrit"
+            script: git-mirror-2way-pipeline.groovy
+            github:
+              url: "https://github.com/Mirantis/contrail-kubernetes"
+          trigger:
+            github:
+            pollscm:
+              spec: ${_param:jenkins_pollscm_spec}
+          param:
+            SOURCE_URL:
+              type: string
+              default: "${_param:jenkins_gerrit_url}/contrail/contrail-kubernetes.git"
+            TARGET_URL:
+              type: string
+              default: "https://github.com/Mirantis/contrail-kubernetes.git"
+            CREDENTIALS_ID:
+              type: string
+              default: "gerrit"
+            BRANCHES:
+              type: string
+              default: ${_param:contrail_kubernetes_branches}
diff --git a/jenkins/client/job/opencontrail/git-mirrors/downstream.yml b/jenkins/client/job/opencontrail/git-mirrors/downstream.yml
new file mode 100644
index 0000000..f10e339
--- /dev/null
+++ b/jenkins/client/job/opencontrail/git-mirrors/downstream.yml
@@ -0,0 +1,93 @@
+classes:
+  - system_extra.jenkins.client.job.common
+parameters:
+  jenkins:
+    client:
+      job_template:
+        git-mirror:
+          name: git-mirror-{{name}}
+          jobs:
+            - name: contrail-build
+            - name: contrail-controller
+            - name: contrail-vrouter
+            - name: contrail-third-party
+            - name: contrail-generateDS
+            - name: contrail-sandesh
+            - name: contrail-packages
+            - name: contrail-nova-vif-driver
+            - name: contrail-neutron-plugin
+            - name: contrail-nova-extensions
+            - name: contrail-ceilometer-plugin
+            - name: contrail-heat
+            - name: contrail-web-storage
+            - name: contrail-web-server-manager
+            - name: contrail-web-controller
+            - name: contrail-web-core
+            - name: contrail-webui-third-party
+            - name: contrail-dpdk-extra-packages
+            - name: contrail-kubernetes
+          template:
+            discard:
+              build:
+                keep_num: 10
+              artifact:
+                keep_num: 10
+            type: workflow-scm
+            concurrent: false
+            scm:
+              type: git
+              url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+              credentials: "gerrit"
+              script: git-mirror-pipeline.groovy
+              github:
+                url: "https://github.com/Juniper/{{name}}"
+            trigger:
+              github:
+              pollscm:
+                spec: ${_param:jenkins_pollscm_spec}
+            param:
+              SOURCE_URL:
+                type: string
+                default: "https://github.com/Juniper/{{name}}.git"
+              TARGET_URL:
+                type: string
+                default: "${_param:jenkins_gerrit_url}/contrail/{{name}}.git"
+              CREDENTIALS_ID:
+                type: string
+                default: "gerrit"
+              BRANCHES:
+                type: string
+                default: ${_param:contrail_branches}
+      job:
+        git-mirror-ifmap-python-client:
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
+          type: workflow-scm
+          concurrent: false
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+            credentials: "gerrit"
+            script: git-mirror-pipeline.groovy
+            github:
+              url: "https://github.com/tcpcloud/ifmap-python-client"
+          trigger:
+            github:
+            pollscm:
+              spec: ${_param:jenkins_pollscm_spec}
+          param:
+            SOURCE_URL:
+              type: string
+              default: "https://github.com/tcpcloud/ifmap-python-client.git"
+            TARGET_URL:
+              type: string
+              default: "${_param:jenkins_gerrit_url}/contrail/ifmap-python-client.git"
+            CREDENTIALS_ID:
+              type: string
+              default: "gerrit"
+            BRANCHES:
+              type: string
+              default: "master"
diff --git a/jenkins/client/job/opencontrail/git-mirrors/init.yml b/jenkins/client/job/opencontrail/git-mirrors/init.yml
new file mode 100644
index 0000000..b73dfe5
--- /dev/null
+++ b/jenkins/client/job/opencontrail/git-mirrors/init.yml
@@ -0,0 +1,4 @@
+classes:
+  - system_extra.jenkins.client.job.opencontrail.git-mirrors.downstream
+  - system_extra.jenkins.client.job.opencontrail.git-mirrors.upstream
+  - system_extra.jenkins.client.job.opencontrail.git-mirrors.2way
diff --git a/jenkins/client/job/opencontrail/git-mirrors/upstream.yml b/jenkins/client/job/opencontrail/git-mirrors/upstream.yml
new file mode 100644
index 0000000..f665658
--- /dev/null
+++ b/jenkins/client/job/opencontrail/git-mirrors/upstream.yml
@@ -0,0 +1,188 @@
+classes:
+  - system_extra.jenkins.client.job.common
+parameters:
+  jenkins:
+    client:
+      job_template:
+        git-mirror-upstream:
+          name: git-mirror-upstream-{{name}}
+          jobs:
+            - name: contrail-build
+              branches: ${_param:contrail_branches}
+            - name: contrail-controller
+              branches: ${_param:contrail_branches}
+            - name: contrail-vrouter
+              branches: ${_param:contrail_branches}
+            - name: contrail-third-party
+              branches: ${_param:contrail_branches}
+            - name: contrail-generateDS
+              branches: ${_param:contrail_branches}
+            - name: contrail-sandesh
+              branches: ${_param:contrail_branches}
+            - name: contrail-packages
+              branches: ${_param:contrail_branches}
+            - name: contrail-nova-vif-driver
+              branches: ${_param:contrail_branches}
+            - name: contrail-neutron-plugin
+              branches: ${_param:contrail_branches}
+            - name: contrail-nova-extensions
+              branches: ${_param:contrail_branches}
+            - name: contrail-ceilometer-plugin
+              branches: ${_param:contrail_ceilometer_plugin_branches}
+            - name: contrail-heat
+              branches: ${_param:contrail_branches}
+            - name: contrail-web-storage
+              branches: ${_param:contrail_branches}
+            - name: contrail-web-server-manager
+              branches: ${_param:contrail_branches}
+            - name: contrail-web-controller
+              branches: ${_param:contrail_branches}
+            - name: contrail-web-core
+              branches: ${_param:contrail_branches}
+            - name: contrail-webui-third-party
+              branches: ${_param:contrail_branches}
+            - name: contrail-dpdk-extra-packages
+              branches: ${_param:contrail_dpdk_extra_branches}
+          template:
+            discard:
+              build:
+                keep_num: 10
+              artifact:
+                keep_num: 10
+            type: workflow-scm
+            concurrent: false
+            scm:
+              type: git
+              url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+              credentials: "gerrit"
+              script: git-mirror-pipeline.groovy
+              github:
+                url: "https://github.com/Mirantis/{{name}}"
+            trigger:
+              github:
+            param:
+              SOURCE_URL:
+                type: string
+                default: "${_param:jenkins_gerrit_url}/contrail/{{name}}.git"
+              TARGET_URL:
+                type: string
+                default: "git@github.com:Mirantis/{{name}}.git"
+              CREDENTIALS_ID:
+                type: string
+                default: "gerrit"
+              BRANCHES:
+                type: string
+                default: "{{branches}}"
+      job:
+        git-mirror-upstream-ifmap-python-client:
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
+          type: workflow-scm
+          concurrent: false
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+            credentials: "gerrit"
+            script: git-mirror-pipeline.groovy
+            github:
+              url: "https://github.com/tcpcloud/ifmap-python-client"
+          param:
+            SOURCE_URL:
+              type: string
+              default: "${_param:jenkins_gerrit_url}/contrail/ifmap-python-client.git"
+            TARGET_URL:
+              type: string
+              default: "git@github.com:Mirantis/ifmap-python-client.git"
+            CREDENTIALS_ID:
+              type: string
+              default: "gerrit"
+            BRANCHES:
+              type: string
+              default: "master"
+        # XXX: this one ccp- prefixed is kind-of obsolete and should be
+        # removed
+        git-mirror-upstream-ccp-contrail-pipeline:
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
+          type: workflow-scm
+          concurrent: false
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+            credentials: "gerrit"
+            script: git-mirror-pipeline.groovy
+            github:
+              url: https://github.com/Mirantis/ccp-contrail-pipeline
+          trigger:
+            gerrit:
+              project:
+                contrail/contrail-pipeline:
+                  branches:
+                    - master
+              message:
+                build_successful: "Build successful"
+                build_unstable: "Build unstable"
+                build_failure: "Build failed"
+              event:
+                ref:
+                  - updated
+          param:
+            SOURCE_URL:
+              type: string
+              default: "${_param:jenkins_contrail_pipeline}"
+            TARGET_URL:
+              type: string
+              default: "git@github.com:Mirantis/ccp-contrail-pipeline.git"
+            CREDENTIALS_ID:
+              type: string
+              default: "gerrit"
+            BRANCHES:
+              type: string
+              default: master
+        git-mirror-upstream-contrail-pipeline:
+          discard:
+            build:
+              keep_num: 10
+            artifact:
+              keep_num: 10
+          type: workflow-scm
+          concurrent: false
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+            credentials: "gerrit"
+            script: git-mirror-pipeline.groovy
+            github:
+              url: https://github.com/Mirantis/contrail-pipeline
+          trigger:
+            gerrit:
+              project:
+                contrail/contrail-pipeline:
+                  branches:
+                    - master
+              message:
+                build_successful: "Build successful"
+                build_unstable: "Build unstable"
+                build_failure: "Build failed"
+              event:
+                ref:
+                  - updated
+          param:
+            SOURCE_URL:
+              type: string
+              default: "${_param:jenkins_contrail_pipeline}"
+            TARGET_URL:
+              type: string
+              default: "git@github.com:Mirantis/contrail-pipeline.git"
+            CREDENTIALS_ID:
+              type: string
+              default: "gerrit"
+            BRANCHES:
+              type: string
+              default: master
diff --git a/jenkins/client/job/opencontrail/init.yml b/jenkins/client/job/opencontrail/init.yml
new file mode 100644
index 0000000..0a6613d
--- /dev/null
+++ b/jenkins/client/job/opencontrail/init.yml
@@ -0,0 +1,9 @@
+classes:
+  - system_extra.jenkins.client.job.opencontrail.build
+  - system_extra.jenkins.client.job.opencontrail.git-mirrors
+parameters:
+  _param:
+    contrail_branches: "R3.0.2.x,R3.0.3.x,R3.1,R3.1.1.x,R3.2,master"
+    contrail_kubernetes_branches: "master,release-1.2"
+    contrail_dpdk_extra_branches: "mitaka,kilo,liberty-multiqueue"
+    contrail_ceilometer_plugin_branches: "master"