From 5980f2a4677dfbc528f27de1df75c00c00631626 Mon Sep 17 00:00:00 2001 From: Cian Gallagher Date: Sun, 12 Dec 2021 23:04:19 +0000 Subject: [PATCH] DEV: Add Makefile containing shorthand commands to run test suite, build nad run project. --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9b30cc5 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +.PHONY: build run +.PHONY: test-all test-watcher test-event test-utils + +VERSION := test-build +BUILD := $$(git log -1 --pretty=%h) +BUILD_TIME := $$(date -u +"%Y%m%d.%H%M%S") + +build: + @go build \ + -ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.BuildTime=${BUILD_TIME}" \ + -o ./bin/switchboard ./cmd + +run: + @go run ./cmd/main.go + +test-watcher: + @gotest -v ./watcher + +test-event: + @gotest -v ./event + +test-utils: + @gotest -v ./utils + +test-all: test-watcher test-event test-utils