forked from newrelic/nri-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (24 loc) · 1.02 KB
/
Makefile
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
29
30
31
32
WORKDIR := $(shell pwd)
INTEGRATION := elasticsearch
BINARY_NAME = nri-$(INTEGRATION)
GO_PKGS := $(shell go list ./... | grep -v "/vendor/")
GO_FILES := $(shell find src -type f -name "*.go")
all: build
build: clean test compile
clean:
@echo "=== $(INTEGRATION) === [ clean ]: Removing binaries and coverage file..."
@rm -rfv bin coverage.xml
compile:
@echo "=== $(INTEGRATION) === [ compile ]: Building $(BINARY_NAME)..."
@go build -o bin/$(BINARY_NAME) ./src
test:
@echo "=== $(INTEGRATION) === [ test ]: Running unit tests..."
@go test -race ./... -count=1
integration-test:
@echo "=== $(INTEGRATION) === [ test ]: running integration tests..."
@docker-compose -f tests/integration/docker-compose.yml up -d --build
@go test -v -tags=integration ./tests/integration/. -count=1 ; (ret=$$?; docker-compose -f tests/integration/docker-compose.yml down && exit $$ret)
# Include thematic Makefiles
include $(CURDIR)/build/ci.mk
include $(CURDIR)/build/release.mk
.PHONY: all build clean compile test integration-test