Compare commits

..

4 commits

Author SHA1 Message Date
098a69c047 Makefile: especificar root en ssh
Some checks failed
continuous-integration/drone the build failed
2021-09-18 11:13:44 -03:00
98d2bd9a12 Makefile(ota-js): usar rsync --chgrp
Así no rompemos en entornos sin sudo (la CI) y es menos hacky
2021-09-18 11:12:01 -03:00
a5be895321 woodpecker: no correr yarn ya que se corre solo 2021-09-18 11:04:06 -03:00
78a5a513b6 woodpecker: mandar Telegram siempre 2021-09-18 11:01:40 -03:00
2 changed files with 13 additions and 13 deletions

View file

@ -11,7 +11,6 @@ pipeline:
- chmod 700 ~/.ssh - chmod 700 ~/.ssh
- make bundle hain="sh -c" - make bundle hain="sh -c"
- make yarn hain="sh -c"
- echo -n z8p4KI/XRbGPdxPsNux8ys1gvL4+97DrrvPyt7gugJog3o3x/UEIyedkKUq9FWHOS9ltrsUN6NpN5Dsme+iHbMC/FrRjDmDvOoHpP/pqy924l6IgU8OK3m2Y28AU7eqiYvf6kJd5s4KmPJDiH9AQRx4QRy4jG5DfMHBew6EumqedgvRRFtAc3++GPH2qPnO8SYapRM4FXXUTjP3fNdRVD1Fqm7chUra4Qng1JhnzdMlOUhCPfD1Rmeh+X2TltzYhdPMFH3U3fJV7xCkitxu5PQgWfxMhb9FVF68Uvykbt/rod4IE6ZmAmPyyGktYuQSI2t1kkpAV4MOG4ag9aC/RLmi23rt+fVoYJREHga+NQ0YjVSGbBlINIDACr1iL+abtNmHhtfY+o9unlD7xy3UP0EdqTx6WncVJn02D--pfdBRF+zxL1uqoWs--4OJ7axQaFf9git6zUtUGOA== > config/credentials.yml.enc - echo -n z8p4KI/XRbGPdxPsNux8ys1gvL4+97DrrvPyt7gugJog3o3x/UEIyedkKUq9FWHOS9ltrsUN6NpN5Dsme+iHbMC/FrRjDmDvOoHpP/pqy924l6IgU8OK3m2Y28AU7eqiYvf6kJd5s4KmPJDiH9AQRx4QRy4jG5DfMHBew6EumqedgvRRFtAc3++GPH2qPnO8SYapRM4FXXUTjP3fNdRVD1Fqm7chUra4Qng1JhnzdMlOUhCPfD1Rmeh+X2TltzYhdPMFH3U3fJV7xCkitxu5PQgWfxMhb9FVF68Uvykbt/rod4IE6ZmAmPyyGktYuQSI2t1kkpAV4MOG4ag9aC/RLmi23rt+fVoYJREHga+NQ0YjVSGbBlINIDACr1iL+abtNmHhtfY+o9unlD7xy3UP0EdqTx6WncVJn02D--pfdBRF+zxL1uqoWs--4OJ7axQaFf9git6zUtUGOA== > config/credentials.yml.enc
- make ota-js hain="sh -c" - make ota-js hain="sh -c"
secrets: secrets:
@ -24,3 +23,5 @@ pipeline:
to: 801193228 to: 801193228
secrets: secrets:
- token - token
when:
status: [ success, failure ]

View file

@ -102,21 +102,20 @@ save: ## Subir la imagen Docker al nodo delegado
@echo -e "\a" @echo -e "\a"
ota-js: assets ## Actualizar Javascript en el nodo delegado ota-js: assets ## Actualizar Javascript en el nodo delegado
sudo chgrp -R 82 public/ rsync -avi --chown=:82 --delete-after public/ root@$(delegate):/srv/sutty/srv/http/data/_$(public)/
rsync -avi --delete-after public/ $(delegate):/srv/sutty/srv/http/data/_$(public)/ rsync -avi --chown=:82 --delete-after public/ root@$(delegate):/srv/sutty/srv/http/data/_public/_staging/
rsync -avi --delete-after public/ $(delegate):/srv/sutty/srv/http/data/_public/_staging/ ssh root@$(delegate) docker exec $(container) sh -c "cat /srv/http/tmp/puma.pid | xargs -r kill -USR2"
ssh $(delegate) docker exec $(container) sh -c "cat /srv/http/tmp/puma.pid | xargs -r kill -USR2"
ota: ## Actualizar Rails en el nodo delegado ota: ## Actualizar Rails en el nodo delegado
umask 022; git format-patch $(commit) umask 022; git format-patch $(commit)
scp ./0*.patch $(delegate):/tmp/ scp ./0*.patch root@$(delegate):/tmp/
ssh $(delegate) mkdir -p /tmp/patches-$(commit)/ ssh root@$(delegate) mkdir -p /tmp/patches-$(commit)/
scp ./0*.patch $(delegate):/tmp/patches-$(commit)/ scp ./0*.patch root@$(delegate):/tmp/patches-$(commit)/
scp ./ota.sh $(delegate):/tmp/ scp ./ota.sh root@$(delegate):/tmp/
ssh $(delegate) docker cp /tmp/patches-$(shell echo $(commit) | cut -d / -f 1) $(container):/tmp/ ssh root@$(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 root@$(delegate) docker cp /tmp/ota.sh $(container):/usr/local/bin/ota
ssh $(delegate) docker exec $(container) apk add --no-cache patch ssh root@$(delegate) docker exec $(container) apk add --no-cache patch
ssh $(delegate) docker exec $(container) ota $(commit) ssh root@$(delegate) docker exec $(container) ota $(commit)
rm ./0*.patch rm ./0*.patch
# Todos los archivos de assets. Si alguno cambia, se van a recompilar # Todos los archivos de assets. Si alguno cambia, se van a recompilar