File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments