diff --git a/Makefile b/Makefile index d6ee991d..d8b737c2 100644 --- a/Makefile +++ b/Makefile @@ -8,15 +8,9 @@ hain ?= ENV_FILE=.env $(HAINISH)## UbicaciĆ³n de Hainish test: always ## Ejecutar los tests $(MAKE) rake args="test RAILS_ENV=test $(args)" -postgresql: ## Iniciar la base de datos - pgrep postgres >/dev/null || $(hain) postgresql - serve-js: ## Iniciar el servidor de desarrollo de Javascript $(hain) 'bundle exec ./bin/webpack-dev-server' -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=). $(MAKE) bundle args="exec rails $(args)" diff --git a/Taskfile.yaml b/Taskfile.yaml index 3bb0bdc4..576c5f1c 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -97,3 +97,20 @@ tasks: status: - "test -f ../hain{{.PGPID}}" - "pgrep -F ../hain{{.PGPID}}" + prepare: + desc: "Create database or run pending migrations" + deps: + - "database" + cmds: + - "{{.HAINISH}} bundle exec rails db:prepare" + serve: + desc: "Run Rails development server" + deps: + - "prepare" + - "gems" + cmds: + - ": == Development server running at https://panel.{{.SUTTY_WITH_PORT}} ==" + - "{{.HAINISH}} bundle exec rails server" + status: + - "test -f tmp/pids/server.pid" + - "pgrep -F tmp/pids/server.pid"