From ce2fd301b41f7fe872a2cf13e0217ffe8717f8e0 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 8 Jan 2024 17:25:00 -0300 Subject: [PATCH] feat: reuse tasks --- Taskfile.yaml | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 8d95e302..baacfea3 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -32,7 +32,7 @@ tasks: - "env" - "credentials" cmds: - - "{{.HAINISH}} bundle" + - "go-task bundle" sources: - "Gemfile" generates: @@ -58,9 +58,9 @@ tasks: cmds: - "git lfs fetch" - "git lfs checkout" - - "{{.HAINISH}} RAILS_ENV=production bundle exec rails webpacker:clobber" - - "{{.HAINISH}} RAILS_ENV=production bundle exec rails assets:precompile" - - "{{.HAINISH}} RAILS_ENV=production bundle exec rails assets:clean" + - "go-task bundle rails -- webpacker:clobber RAILS_ENV=production" + - "go-task bundle rails -- assets:precompile RAILS_ENV=production" + - "go-task bundle rails -- assets:clean RAILS_ENV=production" sources: - "package.json" - "yarn.lock" @@ -102,7 +102,7 @@ tasks: deps: - "database" cmds: - - "{{.HAINISH}} bundle exec rails db:prepare" + - "go-task rails -- db:prepare" serve: desc: "Run Rails development server" deps: @@ -110,13 +110,35 @@ tasks: - "gems" cmds: - ": == Development server running at https://panel.{{.SUTTY_WITH_PORT}} ==" - - "{{.HAINISH}} bundle exec rails server" + - "go-task rails -- server" status: - "test -f tmp/pids/server.pid" - "pgrep -F tmp/pids/server.pid" + yarn: + desc: "Yarn. Call with: go-task yarn -- arguments" + deps: + - "node-modules" + cmds: + - "{{.HAINISH}} yarn {{.CLI_ARGS}}" + bundle: + desc: "Bundle. Call with: go-task bundle -- arguments" + deps: + - "gems" + cmds: + - "{{.HAINISH}} bundle {{.CLI_ARGS}}" + rails: + desc: "Rails. Call with: go-task rails -- arguments" + deps: + - "prepare" + cmds: + - "go-task bundle -- exec rails {{.CLI_ARGS}}" + console: + desc: "Rails console" + cmds: + - "go-task rails -- console" doc: desc: "Build documentation" deps: - "gems" cmds: - - "{{.HAINISH}} bundle exec yardoc -o public/doc app lib config db" + - "go-task bundle -- exec yardoc -o public/doc app lib config db"