some config

This commit is contained in:
Your Name 2016-06-24 16:18:17 +08:00
parent 4ea210a05b
commit eae70f9c71
3 changed files with 6 additions and 6 deletions

View File

@ -13,13 +13,13 @@ class QualityAnalysisController < ApplicationController
end end
def create def create
@client = JenkinsApi::Client.new(:server_url => 'http://123.59.135.93:8890', gitlab_address = Redmine::Configuration['gitlab_address']
jenkins_address = Redmine::Configuration['jenkins_address']
@client = JenkinsApi::Client.new(:server_url => jenkins_address,
:username => "temp", :username => "temp",
:password => '123123') :password => '123123')
#@client.exists?(job_name) #@client.exists?(job_name)
@g = Gitlab.client @g = Gitlab.client
gitlab_address = Redmine::Configuration['gitlab_address']
jenkins_address = Redmine::Configuration['jenkins_address']
user_name = User.find(params[:user_id]).try(:login) user_name = User.find(params[:user_id]).try(:login)
branch = params[:branch].nil? ? "master" : params[:branch] branch = params[:branch].nil? ? "master" : params[:branch]
language = params[:language] language = params[:language]
@ -45,7 +45,7 @@ class QualityAnalysisController < ApplicationController
@client = @client.job.create("#{user_name}_#{identifier}", @doc.to_xml) @client = @client.job.create("#{user_name}_#{identifier}", @doc.to_xml)
# relace gitlab hook # relace gitlab hook
# genkins address # genkins address
@g.add_project_hook(@project.gpid, (jenkins_address + "/project/#{user_name}_#{identifier}")) @g.add_project_hook(@project.gpid, jenkins_address + "/project/#{user_name}_#{identifier}")
if qa.nil? if qa.nil?
QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, :sonar_version => version, :path => path, :branch => branch, :language => language) QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, :sonar_version => version, :path => path, :branch => branch, :language => language)
else else

View File

@ -155,7 +155,7 @@ class Project < ActiveRecord::Base
#ActiveModel::Dirty 这里有一个changed方法。对任何对象都可以用 #ActiveModel::Dirty 这里有一个changed方法。对任何对象都可以用
after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?} after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?}
# 创建project之后默认创建一个board之后的board去掉了board的概念 # 创建project之后默认创建一个board之后的board去掉了board的概念
after_create :create_board_sync,:acts_as_forge_activities,:create_project_ealasticsearch_index after_create :create_board_sync,:acts_as_forge_activities
before_destroy :delete_all_members,:delete_project_ealasticsearch_index before_destroy :delete_all_members,:delete_project_ealasticsearch_index
after_update :update_project_ealasticsearch_index after_update :update_project_ealasticsearch_index
def remove_references_before_destroy def remove_references_before_destroy

View File

@ -2,7 +2,7 @@ $('#ajax-modal').html('<%= escape_javascript( render :partial => 'repositories/q
showModal('ajax-modal', '615px'); showModal('ajax-modal', '615px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 580px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>"); $('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 580px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","20%").css("left","30%").css("border","3px solid #269ac9"); $('#ajax-modal').parent().css("top","20%").css("left","32%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls"); $('#ajax-modal').parent().addClass("popbox_polls");