去掉同步过程中输出

This commit is contained in:
huang 2015-11-16 17:19:53 +08:00
parent 913c202536
commit 55d3b8abb3
2 changed files with 0 additions and 36 deletions

View File

@ -12,45 +12,15 @@ namespace :sync_rep do
puts count
unless count > 1
rep.identifier
puts "################################"
puts project.id
puts rep.id
s = Trustie::Gitlab::Sync.new
s.sync_project(project, path: rep.identifier, import_url: rep.url)
rep.type = 'Repository::Gitlab'
rep.save
puts "*************************************"
puts project.id
puts rep.id
puts rep.identifier
end
end
end
end
task :delete_rep => :environment do
projects = Project.where("user_id !=?",12)
projects.each do |project|
# 针对类型为Git并且只有一个版本库的项目
if project.repositories && project.repositories.count == 1 && project.repositories.first.type == "Repository::Git"
rep = project.repositories.first
count = Repository.find_by_sql("SELECT * FROM `repositories` where identifier = '#{rep.identifier}'").count
puts count
unless count > 1
rep.identifier
puts "################################"
puts project.id
puts rep.id
s = Trustie::Gitlab::Sync.new
s.sync_project(project, path: rep.identifier, import_url: rep.url)
rep.type = 'Repository::Gitlab'
rep.save
puts "*************************************"
puts project.id
puts rep.id
puts rep.identifier
end
end
end
end
end

View File

@ -73,11 +73,6 @@ module Trustie
# import url http://xianbo_trustie2:1234@repository.trustie.net/xianbo/trustie2.git
# can use password
puts "@@@@@@@@@@@@@@@@@@@@@@@"
puts path
puts project.description
puts gid
puts import_url
gproject = self.g.create_project(path,
path: path,
description: project.description,
@ -91,7 +86,6 @@ module Trustie
import_url: import_url,
visibility_level: project.is_public? ? UserLevel::PUBLIC : UserLevel::PRIVATE
)
puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
project.gpid = gproject.id
project.save!
puts "Successfully created #{project.name}"