From: Lott, Christopher (cl778h) Date: Mon, 16 Mar 2020 14:02:28 +0000 (-0400) Subject: Adjust alarm-go CI job config esp sonar X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=e5e2a4eb015db398b863524abe3690f5076c35cf;p=ci-management.git Adjust alarm-go CI job config esp sonar 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) Change-Id: Ib4dd96a6bf0eee766e2d0bf0b1d3e51d93acb930 --- 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 index cd32d650..00000000 --- a/jjb/ric-plt-alarm-go/build-alarm-go-ubuntu.sh +++ /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 index 00000000..e0abfc4d --- /dev/null +++ b/jjb/ric-plt-alarm-go/prescan-alarm-go-ubuntu.sh @@ -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" diff --git a/jjb/ric-plt-alarm-go/ric-plt-alarm-go.yaml b/jjb/ric-plt-alarm-go/ric-plt-alarm-go.yaml index c82dc54e..a832655b 100644 --- a/jjb/ric-plt-alarm-go/ric-plt-alarm-go.yaml +++ b/jjb/ric-plt-alarm-go/ric-plt-alarm-go.yaml @@ -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