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

aplicar parches en el servidor

This commit is contained in:
f 2021-06-16 12:08:21 -03:00
parent 96a16379bd
commit bd3b117282
2 changed files with 19 additions and 0 deletions

View file

@ -124,10 +124,19 @@ ota: assets
ssh $(delegate) docker exec $(container) sh -c "cat /srv/http/tmp/puma.pid | xargs -r kill -USR2"
# Hotfixes
#
# TODO: Reemplazar esto por git pull en el contenedor
commit ?= origin/rails
ota-rb:
umask 022; git format-patch $(commit)
scp ./0*.patch $(delegate):/tmp/
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-$(commit) $(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
/etc/hosts: always

10
ota.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
set -e
cd /srv/http
for patch in /tmp/patches-${1}/*.patch; do
su -c "patch -Np 1 -i ${patch}" app && rm $patch
done
cat tmp/puma.pid | xargs -r kill -USR2