diff options
author | Yatian XU <yatian.xu@nokia-sbell.com> | 2019-09-15 00:13:07 +0800 |
---|---|---|
committer | Yatian XU <yatian.xu@nokia-sbell.com> | 2019-09-15 03:37:26 +0800 |
commit | c246e2e1ab92c568387c416d45216aba8cf5aa05 (patch) | |
tree | 3a2b8427ac427be6427e65cc31c8a63a68ff41a7 /jjb | |
parent | 23c8ef4ae338959d644ab8a2e931fa303eb35469 (diff) |
Add verify and sonar jobs for vnfsdk/ves_cpplibrary
Issue-ID: VNFSDK-466
Signed-off-by: Yatian XU <yatian.xu@nokia-sbell.com>
Change-Id: I07e21fc6595f2908040ad62304e4c30d51f913de
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/vnfsdk/vnfsdk-ves-agent-cpp.sh | 75 | ||||
-rw-r--r-- | jjb/vnfsdk/vnfsdk-ves-agent.yaml | 17 |
2 files changed, 92 insertions, 0 deletions
diff --git a/jjb/vnfsdk/vnfsdk-ves-agent-cpp.sh b/jjb/vnfsdk/vnfsdk-ves-agent-cpp.sh new file mode 100644 index 000000000..4a2a76a21 --- /dev/null +++ b/jjb/vnfsdk/vnfsdk-ves-agent-cpp.sh @@ -0,0 +1,75 @@ +#!/bin/bash +set -x + +#3rd party +cmake_build_type=RELEASE +LEVELDB_VER=1.22 +THRIFT_VER=0.12.0 +JSON_VER=3.5.0 +SPDLOG_VER=1.3.1 + +sudo yum install -y cppcheck bison libcurl-devel; yum clean all +sudo pip install gcovr + +#cmake +cd /tmp/ +wget https://github.com/Kitware/CMake/releases/download/v3.15.3/cmake-3.15.3-Linux-x86_64.tar.gz +tar xzvf cmake*.tar.gz +sudo rpm -e cmake +sudo ln -s $(pwd)/cmake-3.15.3-Linux-x86_64/bin/cmake /usr/bin/cmake + +#leveldb +cd /tmp +curl -o leveldb.zip https://codeload.github.com/google/leveldb/zip/$LEVELDB_VER +unzip leveldb.zip +rm leveldb.zip +mv leveldb-$LEVELDB_VER leveldb +mkdir leveldb/_build +cd leveldb/_build;cmake .. -DCMAKE_BUILD_TYPE=$cmake_build_type -DCMAKE_POSITION_INDEPENDENT_CODE=ON; make -j 10; sudo make install + +#json +cd /tmp +curl -o json.zip https://codeload.github.com/nlohmann/json/zip/v$JSON_VER +unzip json.zip +rm json.zip +mv json-$JSON_VER json +cd json;mkdir _build +cd _build/;cmake .. -DCMAKE_BUILD_TYPE=$cmake_build_type -DJSON_BuildTests=OFF;make -j 10;sudo make install + +#spdlog +cd /tmp +curl -o spdlog.zip https://codeload.github.com/gabime/spdlog/zip/v$SPDLOG_VER +unzip spdlog.zip +rm spdlog.zip +mv spdlog-$SPDLOG_VER spdlog +cd spdlog;mkdir _build +cd _build/;cmake .. -DCMAKE_BUILD_TYPE=$cmake_build_type -DSPDLOG_BUILD_EXAMPLES=OFF -DSPDLOG_BUILD_BENCH=OFF -DSPDLOG_BUILD_TESTS=OFF; make -j 10; sudo make install + +#thrift +cd /tmp +curl -o thrift.zip https://codeload.github.com/apache/thrift/zip/v$THRIFT_VER +unzip thrift.zip +rm thrift.zip +mv thrift-$THRIFT_VER thrift +cd thrift;mkdir _build +cd _build/;cmake .. -DCMAKE_BUILD_TYPE=$cmake_build_type -DBUILD_PYTHON=OFF -DBUILD_JAVA=OFF -DBUILD_C_GLIB=OFF -DWITH_LIBEVENT=OFF -DWITH_ZLIB=OFF -DWITH_OPENSSL=OFF -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON;make -j 10;sudo make install + +#verify/sonar +if [[ "${JOB_NAME}" == "vnfsdk-ves-agent-cmake-sonar" ]]; then +echo "sonar" +mkdir -p ${BUILD_DIR} +cppcheck --enable=all --inconclusive --xml --xml-version=2 --output-file=${BUILD_DIR}/cppcheck.xml . + +cd ${BUILD_DIR} +cat >> sonar-project.properties <<EOF +sonar.cfamily.gcov.reportsPath=${BUILD_DIR}/coverage +sonar.cppcheck.reportPath=${BUILD_DIR}/cppcheck.xml +sonar.exclusions=**/gen-cpp/**/*,**/build/**/* +sonar.projectBaseDir=${WORKSPACE}/veslibrary/ves_cpplibrary +sonar.cfamily.threads=4 +EOF + +ls ${BUILD_DIR}/sonar-project.properties +cat ${BUILD_DIR}/sonar-project.properties + +fi diff --git a/jjb/vnfsdk/vnfsdk-ves-agent.yaml b/jjb/vnfsdk/vnfsdk-ves-agent.yaml index 6611f5e9b..9be28e091 100644 --- a/jjb/vnfsdk/vnfsdk-ves-agent.yaml +++ b/jjb/vnfsdk/vnfsdk-ves-agent.yaml @@ -11,6 +11,12 @@ mvn-params: '-f veslibrary/ves_javalibrary/evel_javalib2/pom.xml' - '{project-name}-{stream}-{subproject}-verify-java' - '{project-name}-{stream}-{subproject}-merge-java' + - 'gerrit-cmake-verify': + build-timeout: 30 + pre-build: !include-raw-escape: ./vnfsdk-ves-agent-cpp.sh + build-dir: $WORKSPACE/veslibrary/ves_cpplibrary/src/build + make-opts: -j6 + build-node: centos7-builder-4c-4g - gerrit-maven-stage: sign-artifacts: true build-node: centos7-builder-4c-4g @@ -31,6 +37,17 @@ name: vnfsdk-ves-agent-sonar jobs: - gerrit-maven-sonar + - gerrit-cmake-sonar: + build-timeout: 60 + pre-build: !include-raw-escape: ./vnfsdk-ves-agent-cpp.sh + build-dir: $WORKSPACE/veslibrary/ves_cpplibrary/src/build + cmake-opts: '-DENABLE_COVERAGE=on -DCOVERAGE_DIR=coverage' + sonarcloud-api-token: 35a499f7050cdc8df24bcee4eb205f64e0d8c42a + sonarcloud-organization: vnfsdk-ves-agent-vescpplibrary + sonarcloud-project-key: org.onap.vnfsdk.ves-agent:cpplib + make-opts: -j6 + stream: master + build-node: centos7-builder-4c-4g cron: '@daily' build-node: ubuntu1604-builder-4c-4g project: 'vnfsdk/ves-agent' |