diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-28 19:22:45 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-28 19:22:45 +0400 |
commit | 1c5876eb7b2deb069d919bd19b51c9f6218e0f41 (patch) | |
tree | 0d93953103153bcadc96ee9688a1cca43a9711a0 /lib/gitlab/satellite/satellite.rb | |
parent | b4f16faafd5bff1683996152b49342743a0f1a8b (diff) |
Do gitolite calls async. Remove satellite with project remove
Diffstat (limited to 'lib/gitlab/satellite/satellite.rb')
-rw-r--r-- | lib/gitlab/satellite/satellite.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb index 164af55d895..d8e8f58963b 100644 --- a/lib/gitlab/satellite/satellite.rb +++ b/lib/gitlab/satellite/satellite.rb @@ -3,6 +3,8 @@ module Gitlab module Satellite class Satellite + include Gitlab::Popen + PARKING_BRANCH = "__parking_branch" attr_accessor :project @@ -24,8 +26,10 @@ module Gitlab end def create - create_cmd = "git clone #{project.url_to_repo} #{path}" - if system(create_cmd) + output, status = popen("git clone #{project.url_to_repo} #{path}", + Gitlab.config.satellites.path) + + if status.zero? true else Gitlab::GitLogger.error("Failed to create satellite for #{project.name_with_namespace}") @@ -66,6 +70,10 @@ module Gitlab @repo ||= Grit::Repo.new(path) end + def destroy + FileUtils.rm_rf(path) + end + private # Clear the working directory |