迁移上线

This commit is contained in:
huang 2016-07-19 15:59:52 +08:00
parent 25da65d565
commit cf04bb5ec6
4 changed files with 7 additions and 6 deletions

View File

@ -51,7 +51,7 @@ gem 'elasticsearch-rails'
### profile
gem 'oneapm_rpm'
# gem 'oneapm_rpm'
group :development do
gem 'grape-swagger'

View File

@ -48,7 +48,7 @@ class RepositoriesController < ApplicationController
include RepositoriesHelper
helper :project_score
#@root_path = RepositoriesHelper::ROOT_PATH
require 'net/ssh'
# require 'net/ssh'
rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
def new

View File

@ -23,7 +23,7 @@ class Changeset < ActiveRecord::Base
has_many :filechanges, :class_name => 'Change', :dependent => :delete_all
# fq
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :forge_activities, :class_name => 'ForgeActivity', :as => :forge_act, :dependent => :destroy
# end
#Added by nie
@ -118,7 +118,7 @@ class Changeset < ActiveRecord::Base
# 项目中提交动态类型Changeset
# type0 为老版本即Trsutie数据 1为gitlab中获取的动态
def act_as_forge_activity
self.acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true)
self.forge_acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true)
end
def scan_for_issues

View File

@ -11,8 +11,9 @@ namespace :gitlab do
# 总的提交次数
commit_count = g.user_static(project.gpid, :rev => g_default_branch).count
pages = commit_count / 20 + 1
pages.each do |page|
commits = g.commits(g_project.gpid, :ref_name => g_default_branch, :page => page)
puts "#{pages}"
(0..pages).each do |page|
commits = g.commits(project.gpid, :ref_name => g_default_branch, :page => page)
commits.each do |commit|
Changeset.create(:project_id => project.id, :repository_id => project.gpid, :revision => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at)
end