Merge "CORD-3073 creating mcord deploy+test job on flex-ocp-mcord pod"
diff --git a/jjb/mcord-build.yaml b/jjb/mcord-build.yaml
new file mode 100644
index 0000000..d46ea6b
--- /dev/null
+++ b/jjb/mcord-build.yaml
@@ -0,0 +1,42 @@
+---
+# MCORD 6.0 Build+Test job on Single-Node
+
+- project:
+    name: mcord-build
+
+    project-name: '{name}'
+
+    jobs:
+      - 'mcord_build_test'
+
+- job-template:
+    id: mcord_build_test
+    name: 'mcord_build_test'
+    description: |
+      Created by {id} job-template from ci-management/jjb/mcord-build.yaml
+
+    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}'
+
+    parameters:
+      - string:
+          name: executorNode
+          default: 'flex-ocp-mcord'
+          description: 'Name of the Jenkins node to run the job on'
+
+      - string:
+         name: notificationEmail
+         default: 'kailash@opennetworking.org, you@opennetworking.org, suchitra@opennetworking.org'
+         description: 'List of email recipients'
+
+    project-type: pipeline
+    concurrent: false
+
+    dsl: !include-raw-escape: pipeline/mcord-deployment.groovy
diff --git a/jjb/pipeline/mcord-deployment.groovy b/jjb/pipeline/mcord-deployment.groovy
new file mode 100644
index 0000000..d1922b6
--- /dev/null
+++ b/jjb/pipeline/mcord-deployment.groovy
@@ -0,0 +1,65 @@
+/* mcord-in-a-box 6.0 pipeline build and test*/
+
+pipeline {
+
+  /* no label, executor is determined by JJB */
+  agent {
+    label "${params.executorNode}"
+  }
+
+  stages {
+
+    stage ('Checkout Automation-Tools Repo') {
+      steps {
+        sh '''
+            pushd $WORKSPACE
+            git clone https://gerrit.opencord.org/automation-tools
+            popd
+            '''
+            }
+        }
+
+    stage ('Install MCORD') {
+      steps {
+        sh '''
+            pushd $WORKSPACE
+            ./automation-tools/mcord/mcord-in-a-box.sh
+            popd
+            '''
+            }
+        }
+
+    stage ('Test MCORD') {
+      steps {
+        sh '''
+            pushd $WORKSPACE
+            git clone https://gerrit.opencord.org/mcord
+            cd mcord/test
+            ansible-playbook -i localhost, mcord-cavium-test-playbook.yml
+            popd
+            '''
+            }
+        }
+    }
+
+    post {
+        always {
+            sh '''
+                pushd $WORKSPACE
+                kubectl get pods --all-namespaces
+                if [ -x "/usr/bin/helm" ]; then
+                    helm list
+                    helm delete --purge xos-core
+                    helm delete --purge mcord
+                    helm delete --purge base-openstack
+                    helm reset --force
+                fi
+                if [ -x "/usr/bin/kubelet" ]; then
+                    sudo rm /usr/bin/kubelet
+                fi
+                popd
+                '''
+            step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
+     }
+    }
+}