mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 11:36:21 +00:00
simplificar compilación de assets
This commit is contained in:
parent
baa7d58715
commit
47a6222363
3 changed files with 8 additions and 11 deletions
|
@ -6,5 +6,5 @@
|
||||||
!./Gemfile
|
!./Gemfile
|
||||||
!./Gemfile.lock
|
!./Gemfile.lock
|
||||||
!./config/credentials.yml.enc
|
!./config/credentials.yml.enc
|
||||||
!./public/assets-production/
|
!./public/assets/
|
||||||
!./public/packs-production/
|
!./public/packs/
|
||||||
|
|
|
@ -56,8 +56,8 @@ RUN mv ../sutty/.bundle ./.bundle
|
||||||
# Instalar secretos
|
# Instalar secretos
|
||||||
COPY --chown=app:root ./config/credentials.yml.enc ./config/
|
COPY --chown=app:root ./config/credentials.yml.enc ./config/
|
||||||
# Traer los assets pre-compilados
|
# Traer los assets pre-compilados
|
||||||
COPY --chown=app:www-data ./public/assets-production ./public/assets
|
COPY --chown=app:www-data ./public/assets ./public/assets
|
||||||
COPY --chown=app:www-data ./public/packs-production ./public/packs
|
COPY --chown=app:www-data ./public/packs ./public/packs
|
||||||
|
|
||||||
# Eliminar la necesidad de un runtime JS en producción, porque los
|
# Eliminar la necesidad de un runtime JS en producción, porque los
|
||||||
# assets ya están pre-compilados.
|
# assets ya están pre-compilados.
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -9,14 +9,10 @@ assets := package.json yarn.lock $(shell find app/assets/ app/javascript/ -type
|
||||||
|
|
||||||
alpine_version := 3.12
|
alpine_version := 3.12
|
||||||
|
|
||||||
public/assets-production/: $(assets)
|
public/packs/manifest.json: $(assets)
|
||||||
RAILS_ENV=production bundle exec rake assets:precompile assets:clean
|
PANEL_URL=https://panel.sutty.nl RAILS_ENV=production NODE_ENV=production bundle exec rake assets:precompile assets:clean
|
||||||
rsync --delete-after -a public/assets/ $@
|
|
||||||
|
|
||||||
public/packs-production/: public/packs/
|
assets: public/packs/manifest.json
|
||||||
rsync -a --delete-after $< $@
|
|
||||||
|
|
||||||
assets: public/assets-production/ public/packs-production/
|
|
||||||
|
|
||||||
serve:
|
serve:
|
||||||
bundle exec rails s -b "ssl://0.0.0.0:3000?key=../sutty.local/domain/sutty.local.key&cert=../sutty.local/domain/sutty.local.crt"
|
bundle exec rails s -b "ssl://0.0.0.0:3000?key=../sutty.local/domain/sutty.local.key&cert=../sutty.local/domain/sutty.local.crt"
|
||||||
|
@ -33,6 +29,7 @@ build: assets
|
||||||
save:
|
save:
|
||||||
time docker save sutty/sutty:latest | ssh root@$(delegate).sutty.nl docker load
|
time docker save sutty/sutty:latest | ssh root@$(delegate).sutty.nl docker load
|
||||||
date +%F | xargs git tag -f
|
date +%F | xargs git tag -f
|
||||||
|
@echo -e "\a"
|
||||||
|
|
||||||
load:
|
load:
|
||||||
ssh root@sutty.nl sh -c "gunzip -c sutty.latest.gz | docker load"
|
ssh root@sutty.nl sh -c "gunzip -c sutty.latest.gz | docker load"
|
||||||
|
|
Loading…
Reference in a new issue