forked from upmc-enterprises/elasticsearch-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (26 loc) · 969 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
29
30
31
32
33
34
35
36
37
# Makefile for the Docker image upmcenterprises/elasticsearch-operator
# MAINTAINER: Steve Sloka <[email protected]>
.PHONY: all build container push clean test
TAG ?= 0.2.0
PREFIX ?= upmcenterprises
pkgs = $(shell go list ./... | grep -v /vendor/ | grep -v /test/)
# go source files, ignore vendor directory
SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
all: container
build:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -o _output/bin/elasticsearch-operator --ldflags '-w' ./cmd/operator/main.go
container: build
docker build -t $(PREFIX)/elasticsearch-operator:$(TAG) .
push:
docker push $(PREFIX)/elasticsearch-operator:$(TAG)
clean:
rm -f elasticsearch-operator
format:
go fmt $(pkgs)
check:
@go tool vet ${SRC}
helm-package:
helm package charts/{elasticsearch,elasticsearch-operator} -d charts
helm repo index --merge charts/index.yaml charts
test: clean
go test $$(go list ./... | grep -v /vendor/)