mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 20:55:46 +08:00
reposyncer同步仓库接口
This commit is contained in:
28
app/models/ob_repository_sync.rb
Normal file
28
app/models/ob_repository_sync.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: ob_repository_syncs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# user_id :integer
|
||||
# name :string(255)
|
||||
# github_address :string(255)
|
||||
# gitee_address :string(255)
|
||||
# github_token :string(255)
|
||||
# gitee_token :string(255)
|
||||
# sync_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_ob_repository_syncs_on_project_id (project_id)
|
||||
# index_ob_repository_syncs_on_user_id (user_id)
|
||||
#
|
||||
|
||||
class ObRepositorySync < ApplicationRecord
|
||||
belongs_to :project
|
||||
belongs_to :user
|
||||
|
||||
has_many :ob_repository_sync_jobs, dependent: :destroy
|
||||
end
|
||||
24
app/models/ob_repository_sync_job.rb
Normal file
24
app/models/ob_repository_sync_job.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: ob_repository_sync_jobs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# ob_repository_sync_id :integer
|
||||
# github_branch :string(255)
|
||||
# gitee_branch :string(255)
|
||||
# gitlink_branch :string(255)
|
||||
# job_type :string(255)
|
||||
# base :string(255)
|
||||
# job_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_ob_repository_sync_jobs_on_ob_repository_sync_id (ob_repository_sync_id)
|
||||
#
|
||||
|
||||
class ObRepositorySyncJob < ApplicationRecord
|
||||
belongs_to :ob_repository_sync
|
||||
|
||||
end
|
||||
@@ -49,7 +49,7 @@ class Repository < ApplicationRecord
|
||||
end
|
||||
|
||||
def url
|
||||
self['url'].blank? ? "#{Rails.application.config_for(:configuration)['platform_url']}/#{self.owner&.login}/#{self.identifier}.git" : self['url']
|
||||
self['url'].blank? ? "#{Gitea.gitea_config[:domain]}/#{self.owner&.login}/#{self.identifier}.git" : self['url']
|
||||
end
|
||||
|
||||
# with repository is mirror
|
||||
|
||||
Reference in New Issue
Block a user