mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-21 17:06:23 +00:00
aplicar parches en el servidor
This commit is contained in:
parent
96a16379bd
commit
bd3b117282
2 changed files with 19 additions and 0 deletions
9
Makefile
9
Makefile
|
@ -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
10
ota.sh
Executable 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
|
Loading…
Reference in a new issue