mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
sync_forge_job的修改
This commit is contained in:
20
app/jobs/sync_repository_job.rb
Normal file
20
app/jobs/sync_repository_job.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class SyncRepositoryJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(login,identifier)
|
||||
Rails.logger.info("#######__________begin_sync_repository_________####")
|
||||
gitea_test_ssh = "sshpass -p '@pd:lk4+407' ssh -o StrictHostKeyChecking=no -p 30122 root@123.59.135.93"
|
||||
gitea_jump_ssh = "sshpass -p '#pd:lk3+407' ssh -o StrictHostKeyChecking=no -p 30122 root@10.9.69.134"
|
||||
gitea_user_repo = "/home/git/gitea-repositories/#{login}"
|
||||
git_clone_bare = "git clone --bare http://git.trustie.net/#{login}/#{identifier}.git"
|
||||
|
||||
gitea_repos = system("#{gitea_test_ssh} && #{gitea_jump_ssh} && cd #{gitea_user_repo} && rm -rf #{identifier}.git && #{git_clone_bare}")
|
||||
|
||||
if gitea_repos
|
||||
Rails.logger.info("########________gitea_clone_success__________##############")
|
||||
else
|
||||
Rails.logger.info("########________gitea_clone_failed_____user_loigin:_#{login}_identifier:__#{identifier}")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user