Phase 1 MVP — echo bot factory
All checks were successful
Docker Build / build-and-push-image (push) Successful in 1m8s
All checks were successful
Docker Build / build-and-push-image (push) Successful in 1m8s
This commit is contained in:
38
Makefile
Normal file
38
Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
SHELL := /bin/bash
|
||||
APP := homelab-gateway
|
||||
IMAGE := gitea.arcodange.lab/arcodange-org/$(APP)
|
||||
TAG ?= dev
|
||||
|
||||
.PHONY: build test vet tidy run docker push setwebhook deletewebhook
|
||||
|
||||
build:
|
||||
go build -o bin/gateway .
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
vet:
|
||||
go vet ./...
|
||||
|
||||
tidy:
|
||||
go mod tidy
|
||||
|
||||
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_<SLUG>_TOKEN and BOT_<SLUG>_SECRET must be exported in your shell.
|
||||
setwebhook:
|
||||
@test -n "$(SLUG)" || (echo "SLUG=<bot-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=<bot-slug> required" && exit 1)
|
||||
go run . deletewebhook --slug $(SLUG)
|
||||
Reference in New Issue
Block a user