2011-04-27 15:21:26 +01:00
|
|
|
namespace :repositories do
|
|
|
|
|
|
|
|
desc "Migrate repositories from fs"
|
|
|
|
task :migrate => :environment do
|
2011-04-27 15:55:23 +01:00
|
|
|
repo_dirs = Dir["/root/mandriva_main_git/*.git"]
|
2011-04-27 15:38:59 +01:00
|
|
|
|
2011-04-27 15:21:26 +01:00
|
|
|
cooker = Platform.find_by_name!("cooker")
|
|
|
|
main = cooker.repositories.find_by_name!("main")
|
|
|
|
|
2011-04-27 15:55:23 +01:00
|
|
|
repo_dirs.each do |repo_dir|
|
2011-04-27 15:21:26 +01:00
|
|
|
puts repo_dir
|
2011-04-27 15:56:55 +01:00
|
|
|
project_name = File.basename(repo_dir, ".git")
|
2011-04-27 15:55:23 +01:00
|
|
|
puts project_name
|
|
|
|
|
2011-04-27 15:21:26 +01:00
|
|
|
|
|
|
|
# main.projects.create(:name => project_name, :unixname => project_name)
|
|
|
|
# Dir
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|