-
Notifications
You must be signed in to change notification settings - Fork 126
/
Makefile
42 lines (30 loc) · 1.12 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
# Makefile for the Docker image upmcenterprises/elasticsearch-operator
# MAINTAINER: Steve Sloka <[email protected]>
.PHONY: all build container push clean test
TAG ?= 0.4.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/)
devpreq:
mkdir -p /tmp/certs/config && mkdir -p /tmp/certs/certs
go get -u github.com/cloudflare/cfssl/cmd/cfssl
go get -u github.com/cloudflare/cfssl/cmd/cfssljson