From eae70f9c713b042da1e44f8c95eedddd6ac2b633 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 24 Jun 2016 16:18:17 +0800 Subject: [PATCH] some config --- app/controllers/quality_analysis_controller.rb | 8 ++++---- app/models/project.rb | 2 +- app/views/repositories/quality_analysis.js.erb | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 45d5a0ebf..e9b5c5e4f 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -13,13 +13,13 @@ class QualityAnalysisController < ApplicationController end 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", :password => '123123') #@client.exists?(job_name) @g = Gitlab.client - gitlab_address = Redmine::Configuration['gitlab_address'] - jenkins_address = Redmine::Configuration['jenkins_address'] user_name = User.find(params[:user_id]).try(:login) branch = params[:branch].nil? ? "master" : params[:branch] language = params[:language] @@ -45,7 +45,7 @@ class QualityAnalysisController < ApplicationController @client = @client.job.create("#{user_name}_#{identifier}", @doc.to_xml) # relace gitlab hook # 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? QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, :sonar_version => version, :path => path, :branch => branch, :language => language) else diff --git a/app/models/project.rb b/app/models/project.rb index ceec0e182..55fbb3310 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -155,7 +155,7 @@ class Project < ActiveRecord::Base #ActiveModel::Dirty 这里有一个changed方法。对任何对象都可以用 after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?} # 创建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 after_update :update_project_ealasticsearch_index def remove_references_before_destroy diff --git a/app/views/repositories/quality_analysis.js.erb b/app/views/repositories/quality_analysis.js.erb index eff2825f6..bafe28cdf 100644 --- a/app/views/repositories/quality_analysis.js.erb +++ b/app/views/repositories/quality_analysis.js.erb @@ -2,7 +2,7 @@ $('#ajax-modal').html('<%= escape_javascript( render :partial => 'repositories/q showModal('ajax-modal', '615px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); -$('#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");