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

arreglos de produccion

This commit is contained in:
f 2019-09-16 13:15:20 -03:00
parent c1ebd43835
commit 80ae794f10
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
3 changed files with 10 additions and 4 deletions

View file

@ -13,10 +13,8 @@ class DeployLocal < Deploy
# #
# Pasamos variables de entorno mínimas para no filtrar secretos de # Pasamos variables de entorno mínimas para no filtrar secretos de
# Sutty # Sutty
#
# TODO: Recolectar estadísticas y enviarlas a la base de datos
def deploy def deploy
yarn && bundle && jekyll_build mkdir && yarn && bundle && jekyll_build
end end
# Sólo permitimos un deploy local # Sólo permitimos un deploy local
@ -36,6 +34,10 @@ class DeployLocal < Deploy
private private
def mkdir
FileUtils.mkdir_p destination
end
# Un entorno que solo tiene lo que necesitamos # Un entorno que solo tiene lo que necesitamos
def env def env
# XXX: This doesn't support Windows paths :B # XXX: This doesn't support Windows paths :B

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'zip'
# Genera un ZIP a partir del sitio ya construido # Genera un ZIP a partir del sitio ya construido
# #
# TODO: Firmar con minisign # TODO: Firmar con minisign
@ -13,7 +15,6 @@ class DeployZip < Deploy
# y generar un zip accesible públicamente. # y generar un zip accesible públicamente.
# #
# rubocop:disable Metrics/MethodLength # rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
def deploy def deploy
time_start time_start
Dir.chdir(destination) do Dir.chdir(destination) do

View file

@ -1,11 +1,14 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'test_helper'
class DeployZipTest < ActiveSupport::TestCase class DeployZipTest < ActiveSupport::TestCase
test 'se puede deployear' do test 'se puede deployear' do
deploy_local = create :deploy_local deploy_local = create :deploy_local
assert deploy_local.deploy assert deploy_local.deploy
assert File.directory?(deploy_local.destination) assert File.directory?(deploy_local.destination)
assert File.exist?(File.join(deploy_local.destination, 'robots.txt'))
assert_equal 3, deploy_local.build_stats.count assert_equal 3, deploy_local.build_stats.count
assert deploy_local.build_stats.map(&:bytes).compact.inject(:+).positive? assert deploy_local.build_stats.map(&:bytes).compact.inject(:+).positive?