summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-04-06 15:20:58 +0300
committerValery Sizov <vsv2711@gmail.com>2015-04-06 15:20:58 +0300
commit9c2301808b2d96d41d8972d114c9f77dd2b2471f (patch)
treed47e8894686ae060aed528bef1c0861df2d7478b /app/services
parent0d0042d27481d31027a10edb2ba3a184bff5075a (diff)
downloadgitlab-ce-9c2301808b2d96d41d8972d114c9f77dd2b2471f.tar.gz
CI project forking
Diffstat (limited to 'app/services')
-rw-r--r--app/services/projects/fork_service.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/services/projects/fork_service.rb b/app/services/projects/fork_service.rb
index 6b0d4aca3e1..b5150fefc4c 100644
--- a/app/services/projects/fork_service.rb
+++ b/app/services/projects/fork_service.rb
@@ -40,12 +40,18 @@ module Projects
if project.save
project.team << [@current_user, :master]
end
+
#Now fork the repo
unless gitlab_shell.fork_repository(@from_project.path_with_namespace, project.namespace.path)
raise 'forking failed in gitlab-shell'
end
+
project.ensure_satellite_exists
end
+
+ if @from_project.gitlab_ci?
+ ForkRegistratorWorker.perform_async(@from_project.id, project.id, @current_user.private_token)
+ end
rescue => ex
project.errors.add(:base, 'Fork transaction failed.')
project.destroy