Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-09-16 12:43:16 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-18 19:02:11 +0300
commita0c1a12dee276f5d587514d24432e7647e07aeec (patch)
tree8c5797f2fff43c72361343dbcd70d1cd13067a88 /app/services
parentbdfe6b9603a7a6947644929c4ea966018f98c840 (diff)
remove API calls from CE to CI
Diffstat (limited to 'app/services')
-rw-r--r--app/services/ci/create_project_service.rb9
-rw-r--r--app/services/projects/fork_service.rb2
2 files changed, 3 insertions, 8 deletions
diff --git a/app/services/ci/create_project_service.rb b/app/services/ci/create_project_service.rb
index 0419612d521..839d3f6b444 100644
--- a/app/services/ci/create_project_service.rb
+++ b/app/services/ci/create_project_service.rb
@@ -2,20 +2,15 @@ module Ci
class CreateProjectService
include Gitlab::Application.routes.url_helpers
- def execute(current_user, params, project_route, forked_project = nil)
+ def execute(current_user, params, forked_project = nil)
@project = Ci::Project.parse(params)
Ci::Project.transaction do
@project.save!
- data = {
- token: @project.token,
- project_url: project_route.gsub(":project_id", @project.id.to_s),
- }
-
gl_project = ::Project.find(@project.gitlab_id)
gl_project.build_missing_services
- gl_project.gitlab_ci_service.update_attributes(data.merge(active: true))
+ gl_project.gitlab_ci_service.update_attributes(active: true, token: @project.token)
end
if forked_project
diff --git a/app/services/projects/fork_service.rb b/app/services/projects/fork_service.rb
index 50f208b11d1..2e995d6fd51 100644
--- a/app/services/projects/fork_service.rb
+++ b/app/services/projects/fork_service.rb
@@ -18,7 +18,7 @@ module Projects
if new_project.persisted?
if @project.gitlab_ci?
- ForkRegistrationWorker.perform_async(@project.id, new_project.id, @current_user.private_token)
+ @project.gitlab_ci_service.fork_registration(new_project, @current_user)
end
end