From 4e74204931a509e9edeba0f55bf516e0a6be1ab7 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 8 Jan 2024 16:55:58 -0300 Subject: [PATCH] feat: servidor de desarrollo --- Makefile | 6 ------ Taskfile.yaml | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) 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"