change bugs
This commit is contained in:
parent
804e971314
commit
4aec62fc33
|
@ -21,7 +21,7 @@ class SyncForgeController < ApplicationController
|
||||||
project = Projects::CreateService.new(project_user, project_params).call
|
project = Projects::CreateService.new(project_user, project_params).call
|
||||||
if project.present?
|
if project.present?
|
||||||
ProjectScore.create!( sync_params[:project_score].merge(project_id: project.id)) if sync_params[:project_score]
|
ProjectScore.create!( sync_params[:project_score].merge(project_id: project.id)) if sync_params[:project_score]
|
||||||
SyncRepositoryJob.perform_later(project.repository, sync_params[:repository_params]) if sync_params[:repository_params]
|
SyncRepositoryJob.perform_later(project.repository, sync_params[:repository]) if sync_params[:repository]
|
||||||
check_new_project(project, sync_params)
|
check_new_project(project, sync_params)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -69,8 +69,8 @@ class SyncForgeController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def check_sync_project(project,sync_params)
|
def check_sync_project(project,sync_params)
|
||||||
if sync_params[:repository_params].present? #仓库存在
|
if sync_params[:repository].present? #仓库存在
|
||||||
change_project_score(project, sync_params[:project_score], sync_params[:repository_params]) #更新project_score
|
change_project_score(project, sync_params[:project_score], sync_params[:repository]) #更新project_score
|
||||||
end
|
end
|
||||||
change_project_issues(project, sync_params[:issues],project.id)
|
change_project_issues(project, sync_params[:issues],project.id)
|
||||||
change_project_members(project, sync_params[:members])
|
change_project_members(project, sync_params[:members])
|
||||||
|
|
|
@ -7,9 +7,9 @@ class SyncProjectsJob < ApplicationJob
|
||||||
def perform(sync_params)
|
def perform(sync_params)
|
||||||
SyncLog.sync_log.info("==========begin to sync #{sync_params[:type]} to forge============")
|
SyncLog.sync_log.info("==========begin to sync #{sync_params[:type]} to forge============")
|
||||||
begin
|
begin
|
||||||
gitea_main = "https://trustie.net"
|
gitea_main = "https://ucloudtest.trustie.net/"
|
||||||
if request.subdomain === 'testforgeplus'
|
if request.subdomain === 'forgeplus'
|
||||||
gitea_main = "https://ucloudtest.trustie.net/"
|
gitea_main = "https://trustie.net"
|
||||||
end
|
end
|
||||||
|
|
||||||
url = "#{gitea_main}/sync_forges" #trustie上的相关路由
|
url = "#{gitea_main}/sync_forges" #trustie上的相关路由
|
||||||
|
@ -28,11 +28,11 @@ class SyncProjectsJob < ApplicationJob
|
||||||
create_target(eval(target_jsons), sync_params[:type].to_s)
|
create_target(eval(target_jsons), sync_params[:type].to_s)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
SyncLog.sync_log.info("==========bsync_user_to_forge_failed #{sync_params[:type]}============")
|
SyncLog.sync_log.info("==========sync_project_to_forge_failed #{sync_params[:type]}============")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
SyncLog.sync_log.info("==========bsync_user_to_forge_failed #{sync_params[:type]}============errors:#{e}")
|
SyncLog.sync_log.info("==========sync_project_to_forge_failed #{sync_params[:type]}============errors:#{e}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class SyncRepositoryJob < ApplicationJob
|
||||||
|
|
||||||
def perform(repository, repository_params)
|
def perform(repository, repository_params)
|
||||||
#创建临时文件夹 clone 并强推代码
|
#创建临时文件夹 clone 并强推代码
|
||||||
SyncLog.sync_log("=================begin to sync repository=====================")
|
SyncLog.sync_log("=================begin to sync request trustie repository=====================")
|
||||||
path = "#{Rails.root}/public/cache_repository"
|
path = "#{Rails.root}/public/cache_repository"
|
||||||
unless File.directory?(path)
|
unless File.directory?(path)
|
||||||
FileUtils.mkdir_p(path)
|
FileUtils.mkdir_p(path)
|
||||||
|
|
Loading…
Reference in New Issue