This repository has been archived by the owner on Oct 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
makefile
executable file
·67 lines (47 loc) · 1.51 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
default: push
.EXPORT_ALL_VARIABLES:
# Container
# Specify the tag with git : git tag <value> <hash>
TAG=`git describe --tags`
DATE=`date +%FT%T%z`
GITSHA=`git rev-parse HEAD`
#PREFIX=
#CODE_GEN=v0.15.9
# Testing
#TESTING_NAMESPACE=
#TESTING_DB_IMAGE_START=
#TESTING_DB_IMAGE_UPGRADE=
#TESTING_S3_ACCESS_KEY_ID=
#TESTING_S3_SECRET_ACCESS_KEY=
#TESTING_S3_ENDPOINT=
#TESTING_S3_BUCKET=
# API
API_VERSION=v1beta2
# Name of app/binary
APP_NAME=galera-operator
# Binary output dir
OUTPUT_DIR=bin
# Building LDFLAGS
LDFLAGS=-ldflags="-w -s -X galera-operator/pkg/version.Version=$(TAG) -X galera-operator/pkg/version.Date=$(DATE) -X galera-operator/pkg/version.GitSHA=$(GITSHA)"
.PHONY: build container push clean codegen test
build:
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o $(OUTPUT_DIR)/$(APP_NAME) cmd/galera-operator/main.go
container: build
docker build -t $(PREFIX)/$(APP_NAME):$(TAG) .
push: container
docker push $(PREFIX)/$(APP_NAME):$(TAG)
clean:
rm -rf $(OUTPUT_DIR)
docker rmi -f "$(PREFIX)/$(APP_NAME):$(TAG)" || true
clonegen:
git clone -b $(CODE_GEN) https://github.com/kubernetes/code-generator ./vendor/k8s.io/code-generator
codegen:
./hack/update-codegen.sh
rm ./pkg/client/listers/apigalera/$(API_VERSION)/expansion_generated.go
unittest:
go test -v ./pkg/galera
go test -v ./pkg/controllers/cluster
inite2etest:
./test/init_e2etest.sh
e2etest: inite2etest
go test -d -v ./test/e2e --kubeconfig=/Users/seb/.kube/config --operator-image=$(PREFIX)/$(APP_NAME):$(TAG) --namespace=$(TESTING_NAMESPACE)