Browse Source

change bugs

tags/v1
sylor_huang@126.com 6 years ago
parent
commit
bf61c0e5b3
2 changed files with 2 additions and 4 deletions
  1. +1
    -0
      app/jobs/sync_projects_job.rb
  2. +1
    -4
      app/jobs/sync_repository_job.rb

+ 1
- 0
app/jobs/sync_projects_job.rb View File

@@ -6,6 +6,7 @@ class SyncProjectsJob < ApplicationJob

def perform(sync_params, gitea_main)
SyncLog.sync_log("==========begin to sync #{sync_params[:type]} to forge============")
SyncLog.sync_log("==========sync_params:#{sync_params}============")
begin

url = "#{gitea_main}/sync_forges" #trustie上的相关路由


+ 1
- 4
app/jobs/sync_repository_job.rb View File

@@ -6,8 +6,6 @@ class SyncRepositoryJob < ApplicationJob
def perform(user_login, identifier, repository_params, gitea_main)
#创建临时文件夹 clone 并强推代码
SyncLog.sync_log("=================begin to sync request trustie repository=====================")
SyncLog.sync_log("=================begin to sync repository_params:==#{repository_params}===================")
SyncLog.sync_log("=================repository_url:==#{repository_params[:git_url]}===================")
path = "#{Rails.root}/public/cache_repository"
unless File.directory?(path)
FileUtils.mkdir_p(path)
@@ -16,8 +14,7 @@ class SyncRepositoryJob < ApplicationJob
g_default_branch = repository_params[:default_branch]
image_repo_name = image_url.to_s.split('/')&.last&.chomp('.git')
check_clone = system("cd #{path} and git clone #{image_url}")


SyncLog.sync_log("========check_clone:====cd #{path} and git clone #{image_url}===================")
if check_clone
new_gitlab_url = "http://root:_Trustie_10010@#{gitea_main}/#{user_login}/#{identifier}.git"



Loading…
Cancel
Save