Skip to content

Commit 74c9665

Browse files
author
root
committed
Add Rake task to prepare migration to V0.8
1 parent 39d7123 commit 74c9665

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Diff for: lib/tasks/migration_tools.rake

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
namespace :redmine_git_hosting do
2+
3+
namespace :migration_tools do
4+
5+
task :delete_ssh_key => [:environment] do
6+
puts ""
7+
puts "Delete SSH keys in Gitolite (they will be recreated later)"
8+
puts ""
9+
10+
GitolitePublicKey.all.each do |ssh_key|
11+
repo_key = {}
12+
repo_key['title'] = ssh_key.identifier
13+
repo_key['key'] = ssh_key.key
14+
repo_key['owner'] = ssh_key.owner
15+
repo_key['location'] = ssh_key.location
16+
17+
puts " - Delete SSH key #{ssh_key.identifier}"
18+
RedmineGitolite::GitHosting.resync_gitolite({ :command => :delete_ssh_key, :object => repo_key })
19+
end
20+
puts ""
21+
22+
end
23+
24+
end
25+
26+
desc "Prepare migration to v0.8 version"
27+
task :prepare_migration_to_v08 => [:environment] do
28+
## First step : delete SSH keys
29+
task('redmine_git_hosting:migration_tools:delete_ssh_key').invoke
30+
end
31+
32+
end

0 commit comments

Comments
 (0)