-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (22 loc) · 737 Bytes
/
Copy pathMakefile
File metadata and controls
28 lines (22 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
BIN := listmonk-messenger.bin
LAST_COMMIT := $(shell git rev-parse --short HEAD)
LAST_COMMIT_DATE := $(shell git show -s --format=%ci ${LAST_COMMIT})
VERSION := $(shell git describe --abbrev=1)
BUILDSTR := ${VERSION} (build "\\\#"${LAST_COMMIT} $(shell date '+%Y-%m-%d %H:%M:%S'))
build:
go build -o ${BIN} -ldflags="-X 'main.buildString=${BUILDSTR}'" *.go
.PHONY: build
run: build
@./${BIN}
.PHONY: run
test:
go test ./...
.PHONY: test
# Run integration tests against a fakecloud mock AWS.
COMPOSE := docker compose -f docker-compose.test.yml
test-integration:
$(COMPOSE) up -d --wait
go test -count=1 -v -tags=integration ./...; status=$$?; \
$(COMPOSE) down; exit $$status
.PHONY: test-integration
.DEFAULT_GOAL := build