-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
28 lines (23 loc) · 868 Bytes
/
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
PACKAGE:=github.com/ViaQ/log-exploration-oc-plugin
VERSION:=${shell git describe --tags --always}
BUILDTIME := ${shell date -u '+%Y-%m-%d_%H:%M:%S'}
BUILD_DIR:=./bin
LDFLAGS:= -s -w -X '${PACKAGE}/pkg/version.Version=${VERSION}' \
-X '${PACKAGE}/pkg/version.BuildTime=${BUILDTIME}'
.PHONY: build install test test-e2e
build: test
mkdir -p $(BUILD_DIR)
CGO_ENABLED=0 GOOS=linux go build -ldflags "${LDFLAGS}" -o $(BUILD_DIR)/$(EXECUTABLE) cmd/oc-historical_logs.go
install: build
chmod +x $(BUILD_DIR)/oc-historical_logs
sudo mv $(BUILD_DIR)/oc-historical_logs /usr/local/bin/.
test:
go test ./pkg/... -cover
test-cover:
go test ./pkg/... -coverprofile=coverage.out && go tool cover -html=coverage.out
test-e2e:
docker-compose up -d
chmod +x test/e2e/populate-indices.sh
test/e2e/populate-indices.sh
go test -v test/e2e/*.go
docker-compose down -v