这是我非常简单的C++/CMake .travis.yml
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "<very long encrypted token>"
addons:
coverity_scan:
project:
name: "tinverse/tsm"
build_command_prepend: cmake .
build_command: make
branch_pattern: coverity_scan
script:
- echo -n | openssl s_client -CApath /etc/ssl/certs -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
- clang
compiler:
- gcc
- clang
install:
# Use g++5.4 and not 4.6 (C++11 missing)
- if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi一切都构建得很好。我没有看到coverity运行或上传任何东西。我使用未加密的令牌在travis中添加了一个'COVERITY_SCAN_TOKEN‘环境变量。构建日志在这里:https://travis-ci.org/tinverse/tsm/jobs/509506031。我得到了最后一个"The command“。/configure && make && make test”exited with 0.“来自travis-ci构建日志的消息,仅此而已!不知道我做错了什么。
更新:从构建日志:
depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign CloudSSL CA - SHA256 - G3
verify error:num=20:unable to get local issuer certificate
verify return:0
DONE但是,在将CApath选项添加到.travil.yml中脚本的before_install部分中的openssl命令之后,我看到
echo -n | openssl s_client -CApath /etc/ssl/certs/ -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
depth=2 C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA
verify return:1
depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign CloudSSL CA - SHA256 - G3
verify return:1
depth=0 C = US, ST = Delaware, L = Dover, O = Incapsula Inc, CN = incapsula.com
verify return:1
DONE那么,这里的非零返回是否意味着成功?尽管如此,看看travis-ci的构建日志,我认为coverity扫描没有运行。
发布于 2019-03-23 02:40:07
我的分支名为feature/coverity_scan,我认为branch_pattern: coverity_scan会起作用。事实并非如此。在将我的分支重命名为coverity_scan之后,它起作用了。
此外,将dist: xenial添加到.travis.yml文件可以消除证书错误。
https://stackoverflow.com/questions/55282442
复制相似问题