Adjust alarm-go CI job config esp sonar 07/2807/5
authorLott, Christopher (cl778h) <cl778h@att.com>
Mon, 16 Mar 2020 14:02:28 +0000 (10:02 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Tue, 17 Mar 2020 12:33:54 +0000 (08:33 -0400)
1) Change docker image name from ric-plt-alarm-go to ric-plt-alarmadapter

2) Rename and repair prescan shell script to call commands
cmake (not cmake3) and ninja (not ninja-build); change
to appropriate directory before calling repo build script.

3) Configure report paths for cover.out in adapter and alarm.

Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Change-Id: Ib4dd96a6bf0eee766e2d0bf0b1d3e51d93acb930

jjb/ric-plt-alarm-go/build-alarm-go-ubuntu.sh [deleted file]
jjb/ric-plt-alarm-go/prescan-alarm-go-ubuntu.sh [new file with mode: 0755]
jjb/ric-plt-alarm-go/ric-plt-alarm-go.yaml

diff --git a/jjb/ric-plt-alarm-go/build-alarm-go-ubuntu.sh b/jjb/ric-plt-alarm-go/build-alarm-go-ubuntu.sh
deleted file mode 100755 (executable)
index cd32d65..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-# Installs NNG then run a build script in the repository
-# Assumes ubuntu - uses apt-get
-
-echo "--> build-alarm-go-ubuntu.sh"
-
-echo "Install packages"
-sudo apt-get install -y cmake ninja-build
-
-# NNG repo is not frequently tagged so it's pinned to a commit hash.
-# This commit provides fix to the proxy-reconnect
-# bug that we identified:  https://github.com/nanomsg/nng/issues/970
-echo "Clone and build NNG"
-git clone https://github.com/nanomsg/nng.git
-(cd nng \
-    && git checkout e618abf8f3db2a94269a79c8901a51148d48fcc2 \
-    && mkdir build \
-    && cd build \
-    && cmake3 -DBUILD_SHARED_LIBS=1 -G Ninja .. \
-    && ninja-build \
-    && sudo ninja-build install)
-
-cmd="./adapter/build_adapter.sh"
-echo "INFO: invoking build script: $cmd"
-$cmd
-
-echo "--> build-alarm-go-ubuntu.sh ends"
diff --git a/jjb/ric-plt-alarm-go/prescan-alarm-go-ubuntu.sh b/jjb/ric-plt-alarm-go/prescan-alarm-go-ubuntu.sh
new file mode 100755 (executable)
index 0000000..e0abfc4
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+# Installs NNG then runs a build script in the repository
+# Assumes ubuntu - uses apt-get
+
+echo "--> prescan-alarm-go-ubuntu.sh"
+
+set -ex
+
+sudo apt-get install -y cmake ninja-build
+
+# NNG repo is not frequently tagged so it's pinned to a commit hash.
+# This commit repairs bug https://github.com/nanomsg/nng/issues/970
+git clone https://github.com/nanomsg/nng.git
+(cd nng \
+    && git checkout e618abf8f3db2a94269a79c8901a51148d48fcc2 \
+    && mkdir build \
+    && cd build \
+    && cmake -DBUILD_SHARED_LIBS=1 -G Ninja .. \
+    && ninja \
+    && sudo ninja install)
+
+# build script must start in this subdir
+cd adapter
+bash build_adapter_ubuntu.sh
+
+echo "--> prescan-alarm-go-ubuntu.sh ends"
index c82dc54..a832655 100644 (file)
@@ -27,7 +27,7 @@
     <<: *alarm_go_common
     name: ric-plt-alarm-go-docker
     # image name
-    docker-name: 'o-ran-sc/ric-plt-alarm-go'
+    docker-name: 'o-ran-sc/ric-plt-alarmadapter'
     # source of docker tag
     container-tag-method: yaml-file
     container-tag-yaml-dir: adapter
@@ -46,7 +46,7 @@
     # docker-enabled nodes have golang
     # build script needs ubuntu
     build-node: ubuntu1804-docker-4c-4g
-    sonar-prescan-script: !include-raw-escape: build-alarm-go-ubuntu.sh
+    sonar-prescan-script: !include-raw-escape: prescan-alarm-go-ubuntu.sh
     sonar-project-file: ""
     # use sonarcloud values from defaults.yaml
     sonar-properties: |
@@ -62,7 +62,7 @@
         # Source
         sonar.sources=.
         # Unit tests
-        sonar.go.coverage.reportPaths=coverage.xml
+        sonar.go.coverage.reportPaths=adapter/cover.out,alarm/cover.out
         # Inclusions
         sonar.inclusions=**/*.go
         # Exclusions