问题描述
我想在 Bamboo 中添加一个构建步骤,以便使用 sonarqube 分析代码.我不想为 Bamboo 使用像 Sonar 这样的插件,但想知道是否可以编写脚本作为构建步骤来运行声纳.我已经在我们的构建服务器上下载了 sonarqube,并以管理员身份登录并运行.
I want to add a build step in Bamboo in order to analyze code using sonarqube. I do not want to use any plugin like Sonar for Bamboo but wondering if it is possible to write a script as a build step in order to run sonar. I have downloaded sonarqube on our build server and it is up and running having logged in as admin.
当我在本地进行设置时,我安装了声纳扫描仪并生成了我从项目根文件夹运行的 MSBuild 脚本,但由于它是一个构建服务器并且我在服务器上没有源代码,所以我不能这样做我正在探索如何在不使用插件/插件的情况下将它与 Bamboo 集成.
When I had setup locally, I installed sonar scanner and generated the MSBuild script which I ran from the project root folder but since it is a build server and I do not have the source code on the server I can't do that and I exploring the ways it can be integrated with Bamboo without using a plugin/addon.
非常感谢您对此的任何帮助
Any help on this is greatly appreciated
推荐答案
- 将您的存储库添加到计划中
- 在作业中添加源代码签出步骤
- 将 bash 或 cmd 命令步骤添加到
cd ${bamboo_build_working_directory}
并执行您的声纳脚本或将bamboo_build_working_directory
作为参数传递给您的声纳脚本.bamboo_build_working_directory
将替换为源代码根目录.
- Add your repository to the plan
- Add source code checkout step in the job
- add bash or cmd command step to
cd ${bamboo_build_working_directory}
and execute your sonar script or passbamboo_build_working_directory
as an argument to your sonar script.bamboo_build_working_directory
will be replaced with source code root.
这篇关于在竹子中配置声纳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!