-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
50 lines (39 loc) · 1.36 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
# Makefile for building openebs helm-operator and its tools
# Reference Guide - https://www.gnu.org/software/make/manual/make.html
REPONAME = openebs
IMGNAME = helm-operator
IMGTAG = v0.0.9
OPENEBS_RELEASE_VERSION = 3.0.0
IS_DOCKER_INSTALLED = $(shell which docker >> /dev/null 2>&1; echo $$?)
.PHONY: all
all: build image registry
.PHONY: deps
deps: _build_check_docker
_build_check_docker:
@if [ $(IS_DOCKER_INSTALLED) -eq 1 ]; \
then echo "" \
&& echo "ERROR:\tdocker is not installed. Please install it before build." \
&& echo "" \
&& exit 1; \
fi;
.PHONY: build
build:
@echo "------------------------------------"
@echo "Fetch openebs helm chart from stable"
@echo "------------------------------------"
helm repo add openebs https://openebs.github.io/charts
helm fetch openebs/openebs --version $(OPENEBS_RELEASE_VERSION) --untar --untardir helm-charts/
ls helm-charts/
./hack/pre-install
.PHONY: image
image:
@echo "------------------------------------"
@echo "Build the helm operator image"
@echo "------------------------------------"
docker build . -f build/Dockerfile -t $(REPONAME)/$(IMGNAME):$(IMGTAG)
.PHONY: registry
registry:
@echo "------------------------------------"
@echo "push the operator image to registry"
@echo "------------------------------------"
REPONAME=$(REPONAME) IMGNAME=$(IMGNAME) IMGTAG=$(IMGTAG) ./hack/push