Add sonar job to the MC xAPP jjb template

This change adds the job to trigger sonar scans on the MC-xAPP
repo.

Issue-ID: RIC-632

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Change-Id: I4a21d52640631e019d6fb3b49c5394911af7e3d9
diff --git a/jjb/ric-app-mc/ric-app-mc.yaml b/jjb/ric-app-mc/ric-app-mc.yaml
index 2243867..523943f 100644
--- a/jjb/ric-app-mc/ric-app-mc.yaml
+++ b/jjb/ric-app-mc/ric-app-mc.yaml
@@ -20,6 +20,13 @@
     project: ric-app/mc
     # maven settings file has docker credentials
     mvn-settings: ric-app-mc-settings
+    # jenkins job name prefix
+    project-name: ric-app-mc
+    # test scripts depend on this name
+    build-dir: $WORKSPACE/.build
+    # Use ubuntu base for cmake v3
+    # Use docker variant for packagecloud ruby gem
+    build-node: ubuntu1804-docker-4c-4g
 
 - project:
     <<: *mc_common
@@ -74,3 +81,24 @@
     build-node: centos7-docker-2c-8g
     jobs:
       - '{project-name}-gerrit-release-jobs'
+
+# drive unit tests from root CMake file to gen/analyse coverage data
+- project:
+    <<: *mc_common
+    name: ric-app-mc-sonarqube
+    project-name: ric-app-mc
+    cmake-opts: ""
+    make-opts: test ARGS=-V
+    sonar-project-file: ""
+    sonar-properties: |
+        sonar.login={sonarcloud_api_token}
+        sonar.projectKey={sonarcloud_project_organization}_{project-name}
+        sonar.projectName={project-name}
+        sonar.organization={sonarcloud_project_organization}
+        sonar.build.sourceEncoding=UTF-8
+        sonar.sources=sidecars/listener
+        sonar.cfamily.build-wrapper-output=$WORKSPACE/bw-output
+        sonar.cfamily.gcov.reportsPath=sidecars/listener
+        sonar.cfamily.threads=2
+    jobs:
+      - gerrit-cmake-sonarqube