Merge "CORD-3025 creating aaa-gerrit job"
diff --git a/jjb/cord-test/mcord-build.yaml b/jjb/cord-test/mcord-build.yaml
new file mode 100644
index 0000000..1dff29c
--- /dev/null
+++ b/jjb/cord-test/mcord-build.yaml
@@ -0,0 +1,26 @@
+---
+# POD Nightly Build Pipeline M-CORD Jobs
+
+- project:
+    name: mcord-nightly-build-pipeline
+
+    project-name: '{name}'
+
+    build-timeout: '300'
+
+    jobs:
+      # qct pod 4 build jobs (mcord)
+      - 'build_pod_manual':
+         pod: 'qct-pod4'
+         pod_config: 'qct-pod4.yml'
+         profile: 'mcord'
+         branch: 'cord-4.1'
+         Jenkinsfile: 'Jenkinsfile.newBuildSystem'
+
+      # qct pod 4 test jobs
+      - 'build_pod_manual_test':
+         pod: 'qct-pod4'
+         pod_config: 'qct-pod4.yml'
+         profile: 'mcord'
+         branch: 'cord-4.1'
+         Jenkinsfile: 'Jenkinsfile-mcord'
diff --git a/jjb/cord-test/nightly-build-pipeline.yaml b/jjb/cord-test/nightly-build-pipeline.yaml
index d38334f..f82b78d 100644
--- a/jjb/cord-test/nightly-build-pipeline.yaml
+++ b/jjb/cord-test/nightly-build-pipeline.yaml
@@ -187,3 +187,114 @@
       - reverse:
           jobs: 'build_{profile}_{pod}_{branch}'
           result: 'failure'
+
+- job-template:
+    name: 'build_{profile}_{pod}_manual_{branch}'
+    id: build_pod_manual
+    description: |
+                  <!-- Managed by Jenkins Job Builder -->
+                  Nightly Physical POD Builds at {pod} using {pod_config} <br /><br />
+                  Created from job-template {id} from ci-management/jjb/cord-test/cord-test-pipeline.yaml <br />
+                  Created by QA (Suchitra Vemuri - suchitra@opennetworking.org ) <br />
+                  Copyright (c) 2018 Open Networking Foundation (ONF)
+
+    <<: *test-pipe-job-boiler-plate
+
+    parameters:
+      - string:
+         name: devNodeName
+         default: '{pod}'
+         description: 'Jenkins node name of Dev Node'
+
+      - string:
+         name: configRepoUrl
+         default: 'https://gerrit.opencord.org/pod-configs'
+         description: 'The URL of the POD configs repository'
+
+      - string:
+         name: configRepoBaseDir
+         default: 'pod-configs/'
+         description: 'The directory inside the POD configs repository'
+
+      - string:
+         name: configRepoFile
+         default: 'deployment-configs/{pod_config}'
+         description: 'The deployment config file'
+
+      - string:
+         name: branch
+         default: '{branch}'
+
+      - string:
+         name: notificationEmail
+         default: 'kailash@opennetworking.org, you@opennetworking.org, suchitra@opennetworking.org'
+         description: ''
+
+    concurrent: true
+
+    pipeline-scm:
+      script-path: '{Jenkinsfile}'
+      scm:
+        - git:
+           url: '{gerrit-server-url}/cord'
+           branches:
+             - '{branch}'
+
+- job-template:
+    name: 'build_{profile}_{pod}_{branch}_test'
+    id: build_pod_manual_test
+    description: |
+                  <!-- Managed by Jenkins Job Builder -->
+                  Post Tests on {pod} triggered by build_{pod}_{branch} <br /><br />
+                  Created from job-template {id} from ci-management/jjb/cord-test/cord-test-pipeline.yaml <br />
+                  Created by QA (Suchitra Vemuri - suchitra@opennetworking.org) <br />
+                  Copyright (c) 2017 Open Networking Foundation (ONF)
+
+    branches: '{branch}'
+
+    <<: *test-pipe-job-boiler-plate
+
+    parameters:
+      - string:
+         name: devNodeName
+         default: '{pod}'
+         description: 'Jenkins node name of Dev Node'
+
+      - string:
+         name: configRepoUrl
+         default: 'https://gerrit.opencord.org/pod-configs'
+         description: 'The URL of the POD configs repository'
+
+      - string:
+         name: configRepoBaseDir
+         default: 'pod-configs/'
+         description: 'The directory inside the POD configs repository'
+
+      - string:
+         name: configRepoFile
+         default: 'deployment-configs/{pod_config}'
+         description: 'The deployment config file'
+
+      - string:
+         name: branch
+         default: '{branch}'
+
+      - string:
+         name: notificationEmail
+         default: 'kailash@opennetworking.org, you@opennetworking.org, suchitra@opennetworking.org'
+         description: ''
+
+    concurrent: true
+
+    pipeline-scm:
+      script-path: '{Jenkinsfile}'
+      scm:
+        - git:
+           url: '{gerrit-server-url}/cord-tester'
+           branches:
+             - '{branch}'
+
+    triggers:
+      - reverse:
+          jobs: 'build_{profile}_{pod}_manual_{branch}'
+          result: 'failure'
diff --git a/jjb/helm.yaml b/jjb/helm.yaml
new file mode 100644
index 0000000..dbb08e3
--- /dev/null
+++ b/jjb/helm.yaml
@@ -0,0 +1,64 @@
+---
+# CORD helm chart publishing tasks
+
+- project:
+    name: helm-repo
+
+    # add repos that have documentation to the project list in both jobs
+    jobs:
+      - 'publish-helm-repo':
+          project-regexp: '^(helm-charts)$'
+          branch-regexp: '{supported-branches-regexp}'
+
+
+- job-template:
+    id: publish-helm-repo
+    name: 'publish-helm-repo'
+    description: |
+      Created by publish-helm-repo job-template from ci-management/jjb/helm.yaml
+
+    triggers:
+      - cord-infra-gerrit-trigger-merge:
+          gerrit-server-name: '{gerrit-server-name}'
+          project-regexp: '{project-regexp}'
+          branch-regexp: '{branch-regexp}'
+          file-include-regexp: '{all-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:
+      - lf-infra-gerrit-scm:
+          git-url: '$GIT_URL/$GERRIT_PROJECT'
+          refspec: ''
+          branch: '$GERRIT_BRANCH'
+          submodule-recursive: 'false'
+          choosing-strategy: default
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    node: '{build-node}'
+    project-type: freestyle
+    concurrent: false
+
+    builders:
+      - shell: |
+          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: 'CORD Wiki'
+          source: 'chart_repo/**'
+          remove-prefix: 'chart_repo'
+          target: '//var/www/guide/charts/$GERRIT_BRANCH'
+
diff --git a/jjb/sonar.yaml b/jjb/sonar.yaml
index 2c40bce..344a1c2 100644
--- a/jjb/sonar.yaml
+++ b/jjb/sonar.yaml
@@ -57,10 +57,10 @@
     scm:
       - lf-infra-gerrit-scm:
           git-url: '$GIT_URL/$GERRIT_PROJECT'
-          refspec: '$GERRIT_REFSPEC'
+          refspec: ''
           branch: '$GERRIT_BRANCH'
           submodule-recursive: 'false'
-          choosing-strategy: gerrit
+          choosing-strategy: default
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
     node: 'ubuntu16.04-basebuild-1c-2g'
@@ -70,7 +70,8 @@
 # run `pylint --version` before sonarqube, to expose version in logs and to
 # avoid a timeout when sonarqube runs it during analysis.
     builders:
-        - 'cord-infra-sonarqube'
+        - 'cord-infra-sonarqube':
+            project: '{project}'
 
 # run Sonarqube as a verification jobs on individual patchsets
 - job-template:
@@ -113,4 +114,5 @@
 # run `pylint --version` before sonarqube, to expose version in logs and to
 # avoid a timeout when sonarqube runs it during analysis.
     builders:
-        - 'cord-infra-sonarqube'
+        - 'cord-infra-sonarqube':
+            project: '{project}'
diff --git a/packer/provision/basebuild.sh b/packer/provision/basebuild.sh
index 9d09504..2015ef3 100644
--- a/packer/provision/basebuild.sh
+++ b/packer/provision/basebuild.sh
@@ -33,6 +33,7 @@
     # ubuntu_install_java_setup
     # apt-get update
     # apt-get install -y oracle-java8-installer
+    # rm -rf /var/cache/oracle-jdk8-installer
 
     # set up ansible repo
     apt-add-repository -y ppa:ansible/ansible
@@ -121,23 +122,36 @@
     # install sonarqube scanner
     SONAR_SCANNER_CLI_VERSION="3.1.0.1141"
     SONAR_SCANNER_CLI_SHA256SUM="efbe7d1a274bbed220846eccc5b36db853a6bab3ee576aebf93ddc604a89ced4"
-    curl -L -o /tmp/sonarscanner.zip https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_CLI_VERSION}-linux.zip
+    curl -L -o /tmp/sonarscanner.zip "https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_CLI_VERSION}-linux.zip"
     echo "$SONAR_SCANNER_CLI_SHA256SUM  /tmp/sonarscanner.zip" | sha256sum -c -
     pushd /opt
     unzip /tmp/sonarscanner.zip
     mv sonar-scanner-${SONAR_SCANNER_CLI_VERSION}-linux sonar-scanner
+    rm -f /tmp/sonarscanner.zip
     popd
 
-    # install helm (for lint)
+    # install helm
     HELM_VERSION="2.8.2"
     HELM_SHA256SUM="614b5ac79de4336b37c9b26d528c6f2b94ee6ccacb94b0f4b8d9583a8dd122d3"
     HELM_PLATFORM="linux-amd64"
-    curl -L -o /tmp/helm.tgz https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-${HELM_PLATFORM}.tar.gz
+    curl -L -o /tmp/helm.tgz "https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-${HELM_PLATFORM}.tar.gz"
     echo "$HELM_SHA256SUM  /tmp/helm.tgz" | sha256sum -c -
     pushd /tmp
     tar -xzvf helm.tgz
     mv ${HELM_PLATFORM}/helm /usr/local/bin/helm
     chmod a+x /usr/local/bin/helm
+    rm -rf helm.tgz ${HELM_PLATFORM}
+    popd
+
+    # install minikube
+    MINIKUBE_VERSION="0.26.1"
+    MINIKUBE_DEB_VERSION="$(echo ${MINIKUBE_VERSION} | sed -n 's/\(.*\)\.\(.*\)/\1-\2/p')"
+    MINIKUBE_SHA256SUM="4a97ff448347eb374e1c48b4578cc3cf61af51cca4ff002101a57e77ffaa1575"
+    curl -L -o /tmp/minikube.deb "https://storage.googleapis.com/minikube/releases/v${MINIKUBE_VERSION}/minikube_${MINIKUBE_DEB_VERSION}.deb"
+    echo "$MINIKUBE_SHA256SUM  /tmp/minikube.deb" | sha256sum -c -
+    pushd /tmp
+    dpkg -i minikube.deb
+    rm -f minikube.deb
     popd
 
     # clean up
@@ -145,9 +159,6 @@
     apt-get purge -y
     apt-get autoremove -y
     rm -rf /var/lib/apt/lists/*
-    rm -rf /var/cache/oracle-jdk8-installer
-    rm -rf /tmp/sonarscanner.zip
-    rm -rf /tmp/helm.tgz
 }
 
 all_systems() {