2023-07-20 17:58:21 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-07-31 17:18:07 +00:00
|
|
|
# Permite traer los cambios desde webhooks
|
|
|
|
|
2023-07-20 17:58:21 +00:00
|
|
|
class GitPullJob < ApplicationJob
|
|
|
|
# @param :site [Site]
|
2023-07-21 20:12:26 +00:00
|
|
|
# @param :usuarie [Usuarie]
|
2023-07-27 20:02:48 +00:00
|
|
|
# @param :message [String]
|
2023-07-20 17:58:21 +00:00
|
|
|
# @return [nil]
|
2023-07-27 19:46:32 +00:00
|
|
|
def perform(site, usuarie, message)
|
2023-10-31 16:53:45 +00:00
|
|
|
site.repository.fetch
|
|
|
|
|
|
|
|
return if site.repository.up_to_date?
|
|
|
|
|
|
|
|
site.repository.merge(usuarie, message)
|
2023-07-20 17:58:21 +00:00
|
|
|
end
|
2023-07-21 20:12:26 +00:00
|
|
|
end
|