mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 15:06:22 +00:00
feat: correr un comando obteniendo la llave dentro de un archivo temporal
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
99f8947c43
commit
f266de8bed
2 changed files with 20 additions and 1 deletions
|
@ -109,6 +109,21 @@ class Deploy < ApplicationRecord
|
|||
|
||||
private
|
||||
|
||||
# Escribe el contenido en un archivo temporal y ejecuta el bloque
|
||||
# provisto con el archivo como parámetro
|
||||
#
|
||||
# @param :content [String]
|
||||
def with_tempfile(content, &block)
|
||||
Tempfile.create(SecureRandom.hex) do |file|
|
||||
file.write content.to_s
|
||||
file.rewind
|
||||
file.close
|
||||
|
||||
# @yieldparam :file [File]
|
||||
yield file
|
||||
end
|
||||
end
|
||||
|
||||
# @param [String]
|
||||
# @return [String]
|
||||
def readable_cmd(cmd)
|
||||
|
|
|
@ -141,8 +141,12 @@ class DeployLocal < Deploy
|
|||
run %(bundle install --deployment --no-cache --path="#{gems_dir}" --clean --without test development), output: output
|
||||
end
|
||||
|
||||
# TODO: Esto significa que todos los sitios van a tener activity pub
|
||||
# activado
|
||||
def jekyll_build(output: false)
|
||||
run %(bundle exec jekyll build --trace --profile --destination "#{escaped_destination}"), output: output
|
||||
with_tempfile(site.private_key_pem) do |file|
|
||||
run %(bundle exec jekyll build --trace --profile --key #{file.path} --destination "#{escaped_destination}"), output: output
|
||||
end
|
||||
end
|
||||
|
||||
# no debería haber espacios ni caracteres especiales, pero por si
|
||||
|
|
Loading…
Reference in a new issue