mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 13:46:20 +00:00
feat: agregar hosts
This commit is contained in:
parent
064da6cf13
commit
416607df9c
2 changed files with 11 additions and 11 deletions
14
Makefile
14
Makefile
|
@ -42,13 +42,13 @@ help: always ## Ayuda
|
|||
test: always ## Ejecutar los tests
|
||||
$(MAKE) rake args="test RAILS_ENV=test $(args)"
|
||||
|
||||
postgresql: /etc/hosts ## Iniciar la base de datos
|
||||
postgresql: ## Iniciar la base de datos
|
||||
pgrep postgres >/dev/null || $(hain) postgresql
|
||||
|
||||
serve-js: /etc/hosts node_modules ## Iniciar el servidor de desarrollo de Javascript
|
||||
serve-js: node_modules ## Iniciar el servidor de desarrollo de Javascript
|
||||
$(hain) 'bundle exec ./bin/webpack-dev-server'
|
||||
|
||||
serve: /etc/hosts postgresql Gemfile.lock ## Iniciar el servidor de desarrollo de Rails
|
||||
serve: postgresql Gemfile.lock ## Iniciar el servidor de desarrollo de Rails
|
||||
$(MAKE) rails args=server
|
||||
|
||||
rails: ## Corre rails dentro del entorno de desarrollo (pasar argumentos con args=).
|
||||
|
@ -109,12 +109,4 @@ tests := $(shell find test/ -name "*_test.rb")
|
|||
$(tests): always
|
||||
$(MAKE) test args="TEST=$@"
|
||||
|
||||
# Agrega las direcciones locales al sistema
|
||||
/etc/hosts: always
|
||||
@echo "Chequeando si es necesario agregar el dominio local $(SUTTY)"
|
||||
@grep -q " $(SUTTY)$$" $@ || echo -e "127.0.0.1 $(SUTTY)\n::1 $(SUTTY)" | sudo tee -a $@
|
||||
@grep -q " api.$(SUTTY)$$" $@ || echo -e "127.0.0.1 api.$(SUTTY)\n::1 api.$(SUTTY)" | sudo tee -a $@
|
||||
@grep -q " panel.$(SUTTY)$$" $@ || echo -e "127.0.0.1 panel.$(SUTTY)\n::1 panel.$(SUTTY)" | sudo tee -a $@
|
||||
@grep -q " postgresql.$(SUTTY)$$" $@ || echo -e "127.0.0.1 postgresql.$(SUTTY)\n::1 postgresql.$(SUTTY)" | sudo tee -a $@
|
||||
|
||||
.PHONY: always
|
||||
|
|
|
@ -68,3 +68,11 @@ tasks:
|
|||
- "app/javascript/**/*"
|
||||
generates:
|
||||
- "public/packs/manifest.json"
|
||||
hosts:
|
||||
desc: "Local DNS resolution for hostnames"
|
||||
interactive: true
|
||||
cmds:
|
||||
- "echo -e \"127.0.0.1 panel.{{.SUTTY}} api.{{.SUTTY}} postgresql.{{.SUTTY}}\" | sudo tee -a /etc/hosts"
|
||||
- "echo -e \"::1 panel.{{.SUTTY}} api.{{.SUTTY}} postgresql.{{.SUTTY}}\" | sudo tee -a /etc/hosts"
|
||||
status:
|
||||
- "grep -q \" panel.{{.SUTTY}} \" /etc/hosts"
|
||||
|
|
Loading…
Reference in a new issue