Do gitolite calls async. Remove satellite with project remove
This commit is contained in:
parent
b4f16faafd
commit
1c5876eb7b
12 changed files with 90 additions and 52 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue