SHELL := /bin/bash APP := telegram-gateway IMAGE := gitea.arcodange.lab/arcodange/$(APP) TAG ?= dev .PHONY: build test test-race vet tidy run docker push setwebhook deletewebhook compose-up compose-down build: go build -o bin/gateway . test: go test ./... test-race: go test -race -count=1 -timeout 120s ./... vet: go vet ./... tidy: go mod tidy # Local dev stack — Redis (auth) + Postgres (Phase 2b queue) on localhost. compose-up: docker compose up -d --wait compose-down: docker compose down -v run: build CONFIG_PATH=./bots.example.yaml ./bin/gateway serve docker: docker build -t $(IMAGE):$(TAG) . push: docker docker push $(IMAGE):$(TAG) # Usage: make setwebhook SLUG=echo BASE_URL=https://tg.arcodange.fr # BOT__TOKEN and BOT__SECRET must be exported in your shell. setwebhook: @test -n "$(SLUG)" || (echo "SLUG= required" && exit 1) @test -n "$(BASE_URL)" || (echo "BASE_URL=https://… required" && exit 1) go run . setwebhook --slug $(SLUG) --base-url $(BASE_URL) deletewebhook: @test -n "$(SLUG)" || (echo "SLUG= required" && exit 1) go run . deletewebhook --slug $(SLUG)