5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 21:16:23 +00:00

Merge branch 'issue-14169' of https://0xacab.org/sutty/sutty into 17.3.alpine.panel.sutty.nl

This commit is contained in:
Sutty 2023-08-30 19:47:28 +00:00
commit f6ba908eb2
3 changed files with 19 additions and 18 deletions

View file

@ -148,7 +148,7 @@ GEM
devise_invitable (2.0.8)
actionmailer (>= 5.0)
devise (>= 4.6)
distributed-press-api-client (0.2.4)
distributed-press-api-client (0.3.0rc0)
addressable (~> 2.3, >= 2.3.0)
climate_control
dry-schema
@ -582,7 +582,7 @@ DEPENDENCIES
devise
devise-i18n
devise_invitable
distributed-press-api-client (~> 0.2.3)
distributed-press-api-client (~> 0.3.0rc0)
dotenv-rails
down
ed25519

View file

@ -61,14 +61,8 @@ class Deploy < ApplicationRecord
extra_env.merge({
'HOME' => home_dir,
'PATH' => paths.join(':'),
'SPREE_API_KEY' => site.tienda_api_key,
'SPREE_URL' => site.tienda_url,
'AIRBRAKE_PROJECT_ID' => site.id.to_s,
'AIRBRAKE_PROJECT_KEY' => site.airbrake_api_key,
'JEKYLL_ENV' => Rails.env,
'LANG' => ENV['LANG'],
'YARN_CACHE_FOLDER' => yarn_cache_dir,
'GEMS_SOURCE' => ENV['GEMS_SOURCE']
})
end
@ -154,21 +148,14 @@ class Deploy < ApplicationRecord
@deploy_local ||= site.deploys.find_by(type: 'DeployLocal')
end
def non_local_deploys
@non_local_deploys ||= site.deploys.where.not(type: 'DeployLocal')
end
# 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 ||=
non_local_deploys.reduce({}) do |extra_env, deploy|
extra_env.tap do |e|
e.merge! deploy.local_env
end
site.deployment_list.reduce({}) do |extra, deploy|
extra.merge deploy.local_env
end
end
end

View file

@ -76,6 +76,20 @@ class DeployLocal < Deploy
FileUtils.rm_rf(File.join(site.path, '.jekyll-cache'))
end
# Opciones necesarias para la compilación del sitio
#
# @return [Hash]
def local_env
@local_env ||= {
'SPREE_API_KEY' => site.tienda_api_key,
'SPREE_URL' => site.tienda_url,
'AIRBRAKE_PROJECT_ID' => site.id.to_s,
'AIRBRAKE_PROJECT_KEY' => site.airbrake_api_key,
'YARN_CACHE_FOLDER' => yarn_cache_dir,
'GEMS_SOURCE' => ENV['GEMS_SOURCE']
}
end
private
def mkdir
@ -148,7 +162,7 @@ class DeployLocal < Deploy
# @param :args [Hash]
# @return [String]
def extra_flags(**args)
non_local_deploys.map do |deploy|
site.deployment_list.map do |deploy|
deploy.flags_for_build(**args)
end.compact.join(' ')
end