forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (24 loc) · 932 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
# Use:
#
# `make kubectl` will build kubectl.
# `make tag` will suggest a tag.
# `make container` will build a container-- you must supply a tag.
# `make push` will push the container-- you must supply a tag.
kubectl:
KUBE_STATIC_OVERRIDES="kubectl" ../../hack/build-go.sh cmd/kubectl; cp ../../_output/local/bin/linux/amd64/kubectl .
.tag: kubectl
./kubectl version -c | grep -o 'GitVersion:"[^"]*"' | cut -f 2 -d '"' > .tag
tag: .tag
@echo "Suggest using TAG=$(shell cat .tag)"
@echo "$$ make container TAG=$(shell cat .tag)"
@echo "or"
@echo "$$ make push TAG=$(shell cat .tag)"
container:
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' to see a suggestion))
docker build -t gcr.io/google_containers/kubectl:$(TAG) .
push: container
$(if $(TAG),,$(error TAG is not defined. Use 'make tag' to see a suggestion))
gcloud docker push gcr.io/google_containers/kubectl:$(TAG)
clean:
rm -f kubectl
rm -f .tag