2012-06-07 14:44:57 +02:00
|
|
|
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
|
2012-08-11 00:07:50 +02:00
|
|
|
if !is_deploy_key || Key.where(identifier: identifier).count() == 0
|
2012-06-07 14:44:57 +02:00
|
|
|
c.delete_key(identifier)
|
|
|
|
end
|
|
|
|
c.update_projects(projects)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|