mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 12:45:46 +08:00
FIX 优化ci流程,并配置gitea相关database
This commit is contained in:
@@ -21,6 +21,22 @@ module Droneable
|
||||
devops_unverified? && Ci::User.exists?(user_login: self.login)
|
||||
end
|
||||
|
||||
def unbind_account!
|
||||
user_projects = selef.projects
|
||||
|
||||
user_projects.update_all(open_devops: false, open_devops_count: 0)
|
||||
set_drone_step!(User::DEVOPS_UNINIT)
|
||||
|
||||
# TODO
|
||||
# 删除用户项目下的与ci相关的所有webhook
|
||||
user_projects.select(:id, :identifier, :gitea_webhook_id).each do |project|
|
||||
if project.gitea_webhook_id
|
||||
result = Gitea::Hooks::DestroyService.call(self.gitea_token, self.login, project.identifier, project.gitea_webhook_id)
|
||||
project.update_column(:gitea_webhook_id, nil) if result.status == 204
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user