.PHONY: build run sink e2e

ROOT_DIR := $(shell git rev-parse --show-toplevel)

# Brings in `test` (gotestsum) and the build-% rule below; do not redefine
# either here, or make warns and silently picks one.
include $(ROOT_DIR)/scripts/make/go.mk

build:
	make build-alert-triage-adapter BUILD_DIR=cmd/alert-triage-adapter

# Run against a local usher. Everything has a default that works inside RAP.
run:
	go run ./cmd/alert-triage-adapter

# The stand-in for alertstore's callback, for trying the prompt before pointing
# anything at a real deployment.
sink:
	go run ./cmd/callback-sink

# One alert, shaped exactly as alertstore sends them. Needs `make run` and
# `make sink` in other terminals; see hack/fake-dispatch.sh for the options.
e2e:
	./hack/fake-dispatch.sh
