From 1281c239981d9f781f8f6b5e504f8fbc381c79e0 Mon Sep 17 00:00:00 2001 From: Jiro Date: Sat, 15 Aug 2026 09:11:40 +0900 Subject: [PATCH 1/2] feat: add tqdev deployment target Add a deploy-tq-dev Make target that stops services, builds the development binaries, installs tqdev into a configurable directory, and restarts services.\n\nDocument the default destination and ARGS override in the English and Japanese Makefile references.\n\nVerified with make dry runs, make help, and git diff --check. --- Makefile | 10 +++++++++- docs/references/makefile.ja.md | 2 ++ docs/references/makefile.md | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bcde26f..4338ea0 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ help: ## Show target prefixes and available targets. @printf " run-* Processes and commands that run inside the dev container.\n" @printf "\nGeneral:\n" @awk 'BEGIN {FS = ":.*## "}; /^help:.*## / {printf "%-28s %s\n", $$1, $$2}' $(MAKEFILE_LIST) - @awk 'BEGIN {FS = ":.*## "}; /^build-[a-zA-Z0-9_-]+:.*## / {printf "%-28s %s\n", $$1, $$2}' $(MAKEFILE_LIST) + @awk 'BEGIN {FS = ":.*## "}; /^(build|deploy)-[a-zA-Z0-9_-]+:.*## / {printf "%-28s %s\n", $$1, $$2}' $(MAKEFILE_LIST) @printf "\ndev-* targets:\n" @awk 'BEGIN {FS = ":.*## "}; /^dev-[a-zA-Z0-9_-]+:.*## / {printf "%-28s %s\n", $$1, $$2}' $(MAKEFILE_LIST) @printf "\ndc-* targets:\n" @@ -74,6 +74,14 @@ build-tq-dev: ## Build tq and service binaries with the dev profile. go build -o "$(HOME)/.tasq-dev/system/bin/orchestrator" ./cmd/orchestrator go build -ldflags "-X github.com/version-1/tasq/internal/buildinfo.commit=$(TQ_BUILD_COMMIT)" -o "$(HOME)/.tasq-dev/system/bin/web" ./cmd/web +.PHONY: deploy-tq-dev +deploy-tq-dev: ## Stop services, build tqdev, deploy it, and restart services. Usage: make deploy-tq-dev [ARGS=/path/to/bin] + tqdev service stop + $(MAKE) build-tq-dev + mkdir -p "$(if $(strip $(ARGS)),$(ARGS),$(HOME)/.local/bin)" + mv ./tqdev "$(if $(strip $(ARGS)),$(ARGS),$(HOME)/.local/bin)/tqdev" + tqdev service start + .PHONY: dev-check dev-check: @command -v docker >/dev/null 2>&1 || { \ diff --git a/docs/references/makefile.ja.md b/docs/references/makefile.ja.md index 600ba32..33a7f34 100644 --- a/docs/references/makefile.ja.md +++ b/docs/references/makefile.ja.md @@ -116,6 +116,8 @@ make run-logs | `make install-tq-prerelease` | 最新の prerelease から `tq` と管理対象サービスの実行ファイルをインストールします。`gh` が必要です。 | | `make install-tq-prerelease version=v0.1.0-pre.1` | 特定の prerelease タグから `tq` と管理対象サービスの実行ファイルをインストールします。 | | `make build-tq-dev` | `dev` profile を埋め込んだ `tqdev` バイナリをカレントディレクトリに build します。 | +| `make deploy-tq-dev` | `tqdev` のサービスを停止し、`build-tq-dev` を実行して、生成された `tqdev` バイナリを `$HOME/.local/bin` に移動した後、サービスを再起動します。 | +| `make deploy-tq-dev ARGS=/path/to/bin` | 生成された `tqdev` バイナリを `$HOME/.local/bin` の代わりに指定したディレクトリへ配置します。 | タグ、GitHub Actions、GoReleaser を含む全体の流れは [Deployment Flow](../design/deployment.ja.md) を参照してください。 diff --git a/docs/references/makefile.md b/docs/references/makefile.md index 8bd603e..8108937 100644 --- a/docs/references/makefile.md +++ b/docs/references/makefile.md @@ -116,6 +116,8 @@ make run-logs | `make install-tq-prerelease` | Install `tq` and its managed service executables from the latest prerelease. Requires `gh`. | | `make install-tq-prerelease version=v0.1.0-pre.1` | Install `tq` and its managed service executables from a specific prerelease tag. | | `make build-tq-dev` | Build a `tqdev` binary with the `dev` profile in the current directory. | +| `make deploy-tq-dev` | Stop the `tqdev` services, run `build-tq-dev`, move the resulting `tqdev` binary to `$HOME/.local/bin`, and restart the services. | +| `make deploy-tq-dev ARGS=/path/to/bin` | Deploy the resulting `tqdev` binary to the specified directory instead of `$HOME/.local/bin`. | See [Deployment Flow](../design/deployment.md) for the full tag, GitHub Actions, and GoReleaser flow. From cb5b77dfcc0b9a0643cc899d181d00fd05029bfa Mon Sep 17 00:00:00 2001 From: Jiro Date: Sat, 15 Aug 2026 09:13:20 +0900 Subject: [PATCH 2/2] fix: restart services with deployed tqdev Invoke the tqdev binary from the selected deployment directory so ARGS destinations outside PATH restart services with the newly built executable.\n\nVerified default and overridden destinations with make dry runs. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4338ea0..70d8bdd 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ deploy-tq-dev: ## Stop services, build tqdev, deploy it, and restart services. U $(MAKE) build-tq-dev mkdir -p "$(if $(strip $(ARGS)),$(ARGS),$(HOME)/.local/bin)" mv ./tqdev "$(if $(strip $(ARGS)),$(ARGS),$(HOME)/.local/bin)/tqdev" - tqdev service start + "$(if $(strip $(ARGS)),$(ARGS),$(HOME)/.local/bin)/tqdev" service start .PHONY: dev-check dev-check: