-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathMakefile
43 lines (32 loc) · 1.58 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
33
34
35
36
37
38
39
40
41
42
43
include ../../Makefile.common_go
PROJECT=es-sidecar-service
ORG_PATH=github.com/chef/automate/components
PACKAGE_PATH = $(ORG_PATH)/es-sidecar-service
REPO_PATH=$(ORG_PATH)/$(PROJECT)
GIT_SHA = $(shell git rev-parse HEAD)
BUILD_TIME ?= $(shell date -u '+%Y%m%d%H%M%S')
VERSION = ${BUILD_TIME}
GO_LDFLAGS = --ldflags "-X ${LIBRARY_PATH}/version.Version=${BUILD_TIME} -X ${LIBRARY_PATH}/version.GitSHA=${GIT_SHA} -X ${LIBRARY_PATH}/version.BuildTime=${BUILD_TIME}"
ELASTICSEARCH_PORT ?= 9200
ELASTICSEARCH_URL = http://127.0.0.1:$(ELASTICSEARCH_PORT)
default: build
ci: lint unit integration
echo-build-data:
@echo "git_sha: ${GIT_SHA}"
@echo "version: ${VERSION}"
build: echo-build-data
@echo build ${GO_LDFLAGS} cmd/es-sidecar-service/es-sidecar-service.go
@go build ${GO_LDFLAGS} cmd/es-sidecar-service/es-sidecar-service.go
run:
@go run cmd/es-sidecar-service/es-sidecar-service.go --config ./examples/config.dev.toml serve
habitat-build:
hab pkg build .
unit:
go test -v $(shell GOFLAGS='$(GOFLAGS)' go list ./... | grep -v '/integration_test') -cover
integration:
cd ../..; hab studio -D $(STUDIO_OPTS) run "source .studiorc; es_sidecar_service_integration"
purge-es6:
rm -rf "$(PWD)/.tmp/es-sidecar-service-es6-data"
start-es6:
docker rm -f es-sidecar-service-es6 || true
docker run -d -v "$(PWD)/.tmp/es-sidecar-service-es6-data":/usr/share/elasticsearch/data -v "$(PWD)/test/elastic/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml" --name es-sidecar-service-es6 -p $(ELASTICSEARCH_PORT):9200 -p 9305:9300 docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.2