diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-28 23:02:10 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-28 23:02:10 +0400 |
commit | 299a9a10400e7fdcc641a90db95290322058c529 (patch) | |
tree | 3e522bc19287e19c1729104f2827cc240ad64c5d /lib | |
parent | 944b2450b1eb08f3d7fcbfce2cf2ac5ef5544808 (diff) |
keys to gitolite via sidekiq now
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/backend/gitolite.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/gitlab/backend/gitolite.rb b/lib/gitlab/backend/gitolite.rb index 1bcf1264fa9..cd9ac1554d6 100644 --- a/lib/gitlab/backend/gitolite.rb +++ b/lib/gitlab/backend/gitolite.rb @@ -8,14 +8,28 @@ module Gitlab Gitlab::GitoliteConfig.new end - def set_key key_id, key_content, projects + # Update gitolite config with new key + # + # Ex. + # set_key("m_gitlab_com_12343", "sha-rsa ...", [2, 3, 6]) + # + def set_key(key_id, key_content, project_ids) + projects = Project.where(id: project_ids) + config.apply do |config| config.write_key(key_id, key_content) config.update_projects(projects) end end - def remove_key key_id, projects + # Remove ssh key from gitolite config + # + # Ex. + # remove_key("m_gitlab_com_12343", [2, 3, 6]) + # + def remove_key(key_id, project_ids) + projects = Project.where(id: project_ids) + config.apply do |config| config.rm_key(key_id) config.update_projects(projects) |