mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 16:46:22 +00:00
25 lines
720 B
Ruby
25 lines
720 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require 'distributed_press/v1/social/client'
|
||
|
|
||
|
# Publicar novedades al Fediverso
|
||
|
class DeploySocialDistributedPress < Deploy
|
||
|
# Solo luego de publicar remotamente
|
||
|
DEPENDENCIES = %i[deploy_distributed_press deploy_rsync deploy_full_rsync]
|
||
|
|
||
|
# Envía las notificaciones
|
||
|
def deploy(output: false)
|
||
|
with_tempfile(site.private_key_pem) do |file|
|
||
|
run %(bundle exec jekyll notify --trace --key #{file.path} --destination "#{escaped_destination}"), output: output
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# Genera la opción de llave privada para jekyll build
|
||
|
#
|
||
|
# @params :args [Hash]
|
||
|
# @return [String]
|
||
|
def flags_for_build(**args)
|
||
|
"--key #{Shellwords.escape args[:private_key].path}"
|
||
|
end
|
||
|
end
|