diff options
Diffstat (limited to 'app/roles/ssh_key.rb')
-rw-r--r-- | app/roles/ssh_key.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/roles/ssh_key.rb b/app/roles/ssh_key.rb new file mode 100644 index 00000000000..f1143c5d065 --- /dev/null +++ b/app/roles/ssh_key.rb @@ -0,0 +1,18 @@ +module SshKey + def update_repository + Gitlab::GitHost.system.new.configure do |c| + c.update_keys(identifier, key) + c.update_projects(projects) + end + end + + def repository_delete_key + Gitlab::GitHost.system.new.configure do |c| + #delete key file is there is no identically deploy keys + if !is_deploy_key || Key.where(:identifier => identifier).count() == 0 + c.delete_key(identifier) + end + c.update_projects(projects) + end + end +end |