mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-19 08:46:21 +00:00
Merge branch 'issue-10464' into panel.sutty.nl
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
commit
36276f8b5f
4 changed files with 12 additions and 4 deletions
|
@ -13,6 +13,7 @@ class Deploy < ApplicationRecord
|
|||
has_many :build_stats, dependent: :destroy
|
||||
|
||||
DEPENDENCIES = []
|
||||
SOFT_DEPENDENCIES = []
|
||||
|
||||
def deploy(**)
|
||||
raise NotImplementedError
|
||||
|
@ -99,6 +100,13 @@ class Deploy < ApplicationRecord
|
|||
@local_env ||= {}
|
||||
end
|
||||
|
||||
# Trae todas las dependencias
|
||||
#
|
||||
# @return [Array]
|
||||
def self.all_dependencies
|
||||
self::DEPENDENCIES | self::SOFT_DEPENDENCIES
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# @param [String]
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
class DeployFullRsync < DeployRsync
|
||||
SOFT_DEPENDENCIES = %i[
|
||||
deploy_alternative_domain
|
||||
deploy_localized_domain
|
||||
deploy_hidden_service
|
||||
deploy_local
|
||||
deploy_www
|
||||
deploy_zip
|
||||
]
|
||||
|
||||
# Sincroniza las ubicaciones alternativas también, ignorando las que
|
||||
|
@ -17,7 +16,7 @@ class DeployFullRsync < DeployRsync
|
|||
# @return [Boolean]
|
||||
def rsync(output: false)
|
||||
result =
|
||||
SOFT_DEPENDENCIES.map(&:to_s).map(&:classify).map do |dependency|
|
||||
self.class.all_dependencies.map(&:to_s).map(&:classify).map do |dependency|
|
||||
site.deploys.where(type: dependency).find_each.map do |deploy|
|
||||
next unless File.exist? deploy.destination
|
||||
|
||||
|
|
|
@ -155,6 +155,7 @@ class DeployLocal < Deploy
|
|||
# Consigue todas las variables de entorno configuradas por otros
|
||||
# deploys.
|
||||
#
|
||||
# @deprecated Solo tenía sentido para Distributed Press v0
|
||||
# @return [Hash]
|
||||
def extra_env
|
||||
@extra_env ||=
|
||||
|
|
|
@ -18,7 +18,7 @@ class Site
|
|||
end
|
||||
|
||||
deploys.each do |deploy|
|
||||
deploy.class::DEPENDENCIES.each do |dependency|
|
||||
deploy.class.all_dependencies.each do |dependency|
|
||||
deploys.where(type: dependency.to_s.classify).each do |deploy_dependency|
|
||||
graph.add_edge deploy_dependency, deploy
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue