5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 00:51:41 +00:00

Merge branch 'docker' into rails

This commit is contained in:
f 2022-03-09 14:20:26 -03:00
commit d18293bea3

View file

@ -26,7 +26,7 @@ hain ?= ENV_FILE=.env $(HAINISH)## Ubicación de Hainish
#
# Production es el entorno de panel.sutty.nl
ifeq ($(env),production)
container ?= sutty
container ?= panel
## TODO: Cambiar a otra cosa
branch ?= rails
public ?= public
@ -115,15 +115,9 @@ ota-js: assets ## Actualizar Javascript en el nodo delegado
ssh root@$(delegate) docker exec $(container) sh -c "cat /srv/http/tmp/puma.pid | xargs -r kill -USR2"
ota: ## Actualizar Rails en el nodo delegado
umask 022; git format-patch $(commit)
ssh $(delegate) mkdir -p /tmp/patches-$(commit)/
scp ./0*.patch $(delegate):/tmp/patches-$(commit)/
scp ./ota.sh $(delegate):/tmp/
ssh $(delegate) docker cp /tmp/patches-$(shell echo $(commit) | cut -d / -f 1) $(container):/tmp/
ssh $(delegate) docker cp /tmp/ota.sh $(container):/usr/local/bin/ota
ssh $(delegate) docker exec $(container) apk add --no-cache patch
ssh $(delegate) docker exec $(container) ota $(commit)
rm ./0*.patch
ssh $(delegate) git -C /srv/sutty/srv/http/panel.sutty.nl pull ; true
ssh $(delegate) chown -R 1000:82 /srv/sutty/srv/http/panel.sutty.nl
ssh $(delegate) docker exec $(container) rails reload
# Todos los archivos de assets. Si alguno cambia, se van a recompilar
# los assets que luego se suben al nodo delegado.