用竹子配置声纳 [英] configure sonar in bamboo
问题描述
我想在Bamboo中添加一个构建步骤,以便使用sonarqube分析代码.我不想使用类似Sonar for Bamboo的任何插件,但想知道是否有可能编写脚本作为构建步骤以运行声纳.我已经在构建服务器上下载了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
将替换为源代码root.
- 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.
这篇关于用竹子配置声纳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!