Travis
https://github.com/travis-ci/travis.rb#installation
Make sure you have at least Ruby 1.9.3 (2.0.0 recommended) installed.
C:\WINDOWS\system32>ruby --version
ruby 2.6.6p146 (2020-03-31 revision 67876) [x64-mingw32]
You can check your Ruby version by running ruby -v
:
$ ruby -v
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
On Windows:
$ gem install travis
Now make sure everything is working:
$ travis version
1.8.13
See also Note on Ubuntu below.
travis login --pro
Usage # https://docs.travis-ci.com/user/encryption-keys/#usage
The easiest way to encrypt something with the public key is to use Travis CLI. This tool is written in Ruby and published as a gem. First, you need to install the gem:
If you are using travis-ci.com instead of travis-ci.org, you need to login first:
Then, you can use encrypt
command to encrypt data (This example assumes you are running the command in your project directory. If not, add -r owner/project
):
Or, if you are using travis-ci.com, you will need to add --pro
to the CLI:
This will output a string looking something like:
Now you can place it in the .travis.yml
file.
You can also skip the above, and add it automatically by running:
Please note that the name of the environment variable and its value are both encoded in the string produced by “travis encrypt.” You must add the entry to your .travis.yml with key “secure” (underneath the “env” key). This makes the environment variable SOMEVAR with value “secretvalue” available to your program.
You may add multiple entries to your .travis.yml with key “secure.” They will all be available to your program.
Encrypted values can be used in secure environment variables in the build matrix and notifications.
Using SonarCloud with Travis CI
Inspecting code with the SonarQube Scanner #
Before inspecting your code, you need to:
- Create a user authentication token for your account on SonarCloud.
- 这里需要先登录https://travis-ci.org/github/ChuckTest/SonarqubeTest,并且激活这个repository
- Encrypt this token
travis encrypt abcdef0123456789
or defineSONAR_TOKEN
in your Repository Settings - Find which SonarCloud.io organization you want to push your project on and get its key
- Create a
sonar-project.properties
file for your project (see the documentation).
否则会遇到错误repository not known to https://api.travis-ci.com/: ChuckTest/SonarqubeTest
Then add the following lines to your .travis.yml
file to trigger the analysis:
参考https://github.com/ChuckFork/sonarcloud-travis-ci-csharp/tree/dotnet-framewok里面的tools文件夹下的脚本,来进行C#代码扫描的处理
push完成之后,看build的进展是在https://travis-ci.org/github/ChuckTest/SonarqubeTest
之后看sonarqube汇报的问题,https://sonarcloud.io/dashboard?id=ChuckTest_SonarqubeTest
build是日志可以查看
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2019-04-09 sonarqube中new issue的标准
2019-04-09 Custom Quality Profiles in SonarQube
2019-04-09 命令行工具比较 cmd tools comparison
2019-04-09 Hyper