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

Merge branch 'assets' into 'rails'
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

incorporar assets en el repositorio

See merge request sutty/sutty!88
This commit is contained in:
fauno 2023-06-09 16:16:02 +00:00
commit e37d9ac0cc
3 changed files with 5 additions and 20 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
public/assets/** filter=lfs diff=lfs merge=lfs -text
public/packs/** filter=lfs diff=lfs merge=lfs -text

7
.gitignore vendored
View file

@ -34,12 +34,7 @@
/config/master.key /config/master.key
/config/credentials.yml.enc /config/credentials.yml.enc
/public/packs
/public/packs-test /public/packs-test
/public/assets
/public/assets-production
/public/packs
/public/packs-production
/node_modules /node_modules
/yarn-error.log /yarn-error.log
yarn-debug.log* yarn-debug.log*
@ -49,8 +44,6 @@ yarn-debug.log*
*.key *.key
*.crt *.crt
/public/packs
/public/packs-test
/node_modules /node_modules
/yarn-error.log /yarn-error.log
yarn-debug.log* yarn-debug.log*

View file

@ -48,8 +48,6 @@ help: always ## Ayuda
@echo -e "\nArgumentos:\n" @echo -e "\nArgumentos:\n"
@grep -E "^[a-z\-]+ \?=.*##" Makefile | sed -re "s/(.*) \?=.*##(.*)/\1;\2/" | column -s ";" -t | sed -re "s/^([^ ]+) /\x1B[38;5;197m\1\x1B[0m/" @grep -E "^[a-z\-]+ \?=.*##" Makefile | sed -re "s/(.*) \?=.*##(.*)/\1;\2/" | column -s ";" -t | sed -re "s/^([^ ]+) /\x1B[38;5;197m\1\x1B[0m/"
assets: public/packs/manifest.json.br ## Compilar los assets
test: always ## Ejecutar los tests test: always ## Ejecutar los tests
$(MAKE) rake args="test RAILS_ENV=test $(args)" $(MAKE) rake args="test RAILS_ENV=test $(args)"
@ -110,21 +108,13 @@ save: ## Subir la imagen Docker al nodo delegado
date +%F | xargs -I {} git tag -f $(container)-{} date +%F | xargs -I {} git tag -f $(container)-{}
@echo -e "\a" @echo -e "\a"
ota-js: assets ## Actualizar Javascript en el nodo delegado
rsync -avi --delete-after --chown 1000:82 public/ root@$(delegate):/srv/sutty/srv/http/data/_$(public)/
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 ota: ## Actualizar Rails en el nodo delegado
ssh $(delegate) git -C /srv/sutty/srv/http/panel.sutty.nl pull ; true git push
ssh $(delegate) git -C /srv/sutty/srv/http/panel.sutty.nl pull
ssh $(delegate) git -C /srv/sutty/srv/http/panel.sutty.nl lfs prune
ssh $(delegate) chown -R 1000:82 /srv/sutty/srv/http/panel.sutty.nl ssh $(delegate) chown -R 1000:82 /srv/sutty/srv/http/panel.sutty.nl
ssh $(delegate) docker exec $(container) rails reload 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.
assets := package.json yarn.lock $(shell find app/assets/ app/javascript/ -type f)
public/packs/manifest.json.br: $(assets)
$(hain) 'PANEL_URL=https://panel.sutty.nl RAILS_ENV=production NODE_ENV=production bundle exec rake assets:precompile assets:clean'
# Correr un test en particular por ejemplo # Correr un test en particular por ejemplo
# `make test/models/usuarie_test.rb` # `make test/models/usuarie_test.rb`
tests := $(shell find test/ -name "*_test.rb") tests := $(shell find test/ -name "*_test.rb")