pullrequest 升级后自动条用sonar分析

This commit is contained in:
huang 2018-07-04 08:57:24 +08:00
parent d40d33740f
commit 6cc039aceb
1 changed files with 11 additions and 1 deletions

View File

@ -162,12 +162,22 @@ class PullRequestsController < ApplicationController
path = "./"
# qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first
version = 1
properties = "sonar.projectKey=#{job_name}
if language == "java"
properties = "sonar.projectKey=#{job_name}
sonar.projectName=#{job_name}
sonar.projectVersion=#{version}
sonar.sources=#{path}
sonar.language=#{language.downcase}
sonar.sourceEncoding=utf-8
sonar.java.binaries=./"
else
properties = "sonar.projectKey=#{job_name}
sonar.projectName=#{job_name}
sonar.projectVersion=#{version}
sonar.sources=#{path}
sonar.language=#{language.downcase}
sonar.sourceEncoding=utf-8"
end
# 替换配置文件
@doc = Nokogiri::XML(File.open(File.join(Rails.root, 'tmp', 'config.xml')))