-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.istio-api
More file actions
52 lines (36 loc) · 1.45 KB
/
Makefile.istio-api
File metadata and controls
52 lines (36 loc) · 1.45 KB
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
makefile_dir := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
#makefile_dir :=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
current_dir := $(shell pwd)
basename := $(shell basename $(current_dir))
KUBEBUILDER_VER ?= 1.0.8
devcontainer ?= f4tq/kubebuilder:${KUBEBUILDER_VER}
ifeq (,$(PKG))
$(error "You must define the PKG i.e. github.com/f4tq/myproject. The current directory will get mounted at /go/src/$PKG within the container")
endif
ifeq ("","$(wildcard /.dockerenv)")
help:
@echo "go pkg: $(PKG)"
@echo "current directory: $(current_dir)"
@echo "makefile_dir: $(makefile_dir)"
@echo "devcontainer: $(devcontainer)"
@echo "kubebuilder version: $(KUBEBUILDER_VER)"
SHELL:=/bin/bash
include $(makefile_dir)/run_container.mk
all: generate
shell generate ensure cluster-info clean: build-container
shell:
$(call RunContainer,shell)
clean:
$(call RunContainer,make clean)
generate:
$(eval SRC_PKG:= $(shell if [ ! -z "$(src_pkg)" ] ; then echo "src_pkg=$(src_pkg)" ; fi))
$(eval SRC_BRANCH:=$(shell if [ ! -z "$(src_branch)" ] ; then echo "src_branch=$(src_branch)" ; fi))
$(call RunContainer,make $(SRC_PKG) $(SRC_BRANCH) pkg=$(PKG) $@)
cluster-info:
$(call RunContainer,kubectl cluster-info)
ensure:
$(call RunContainer,dep ensure -v)
.PHONY: build-container delete-build-container
build-container delete-build-container:
@set -x ; cd $(makefile_dir) && make KUBEBUILDER_VER=$(KUBEBUILDER_VER) devcontainer=$(devcontainer) $@
endif