File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,34 @@ namespace :redmine_git_hosting do
73
73
74
74
puts "Done!"
75
75
end
76
+
77
+
78
+ desc "Update repositories type (from Git to Xitolite)"
79
+ task :update_repositories_type => [ :environment ] do
80
+
81
+ puts ""
82
+ puts "Update repositories type (from Git to Xitolite) :"
83
+ puts ""
84
+
85
+ Repository ::Git . all . each do |repository |
86
+ # Don't update real Git repositories
87
+ next if repository . url . start_with? ( '/' )
88
+
89
+ # Update Gitolite repositories
90
+ if repository . identifier . nil? || repository . identifier . empty?
91
+ puts repository . project . identifier
92
+ repository . update_attribute ( :type , 'Repository::Xitolite' )
93
+ puts "done!"
94
+ puts ""
95
+ else
96
+ puts repository . identifier
97
+ repository . update_attribute ( :type , 'Repository::Xitolite' )
98
+ puts "done!"
99
+ puts ""
100
+ end
101
+ end
102
+ end
103
+
76
104
end
77
105
78
106
@@ -85,6 +113,8 @@ namespace :redmine_git_hosting do
85
113
task ( 'redmine:plugins:migrate' ) . invoke
86
114
## Rename SSH keys (reset identifier)
87
115
task ( 'redmine_git_hosting:migration_tools:rename_ssh_keys' ) . invoke
116
+ ## Update repositories type
117
+ task ( 'redmine_git_hosting:migration_tools:update_repositories_type' ) . invoke
88
118
end
89
119
90
120
end
You can’t perform that action at this time.
0 commit comments