-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (67 loc) · 2.63 KB
/
Makefile
File metadata and controls
90 lines (67 loc) · 2.63 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# ! IMPORTANT ! We are no longer using `godeps` to run builds. You should
# be using the GO15VENDOREXPERIMENT flag, and your dependencies should
# all be in $DEIS/vendor
SHORT_NAME ?= etcd
VERSION ?= git-$(shell git rev-parse --short HEAD)
# Set these if they are not present in the environment.
export GOARCH ?= amd64
export GOOS ?= linux
export DEIS_REGISTRY ?= ${DEV_REGISTRY}/
# Non-optional environment variables
export GO15VENDOREXPERIMENT=1
export CGO_ENABLED=0
# Environmental details
BINDIR := rootfs/usr/local/bin
LDFLAGS := "-s -X main.version=${VERSION}"
IMAGE_PREFIX ?= deisci
IMAGE := ${DEIS_REGISTRY}${IMAGE_PREFIX}/${SHORT_NAME}:${VERSION}
# Get non-vendor source code directories.
NV := $(shell glide nv)
# Set up the development environment
bootstrap:
glide install
build:
go build -o ${BINDIR}/boot -a -installsuffix cgo -ldflags ${LDFLAGS} boot.go
go build -o ${BINDIR}/discovery -a -installsuffix cgo -ldflags ${LDFLAGS} discovery.go
info:
@echo "Build tag: ${VERSION}"
@echo "Registry: ${DEIS_REGISTRY}"
@echo "Go flags: GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=${CGO_ENABLED}"
@echo "Image: ${IMAGE}"
@echo "Units: ${MANIFESTS}"
clean:
-rm rootfs/bin/boot
docker-build: build
docker build --rm -t ${IMAGE} rootfs
docker-push:
docker push ${IMAGE}
kube-create: kube-service kube-rc
kube-delete:
-kubectl delete rc deis-etcd-1
sleep 5
kube-delete-all: kube-delete
-kubectl delete service deis-etcd-discovery
-kubectl delete rc deis-etcd-discovery
-kubectl delete service deis-etcd-1
-kubectl delete secret deis-etcd-discovery-token
kube-rc: update-manifests
kubectl create -f manifests/deis-etcd-discovery-rc.tmp.yaml
@echo "Pause for discovery service to come online."
sleep 15
kubectl create -f manifests/deis-etcd-rc.tmp.yaml
kube-update: update-manifests
kubectl update -f manifests/deis-etcd-discovery-rc.tmp.yaml
kubectl update -f manifests/deis-etcd-rc.tmp.yaml
kube-service: kube-secrets
-kubectl create -f manifests/deis-etcd-discovery-service.yaml
-kubectl create -f manifests/deis-etcd-service.yaml
kube-secrets:
-kubectl create -f manifests/deis-etcd-discovery-token.yaml
update-manifests:
sed 's#\(image:\) .*#\1 $(IMAGE)#' manifests/deis-etcd-discovery-rc.yaml > manifests/deis-etcd-discovery-rc.tmp.yaml
sed 's#\(image:\) .*#\1 $(IMAGE)#' manifests/deis-etcd-rc.yaml > manifests/deis-etcd-rc.tmp.yaml
test:
@#go test ${NV} # No tests for startup scripts.
@echo "Implement functional tests in _tests directory"
all: build docker-build docker-push kube-clean kube-rc test
.PHONY: build clean docker-build docker-push all kube-clean kube-rc kube-service info kube-secrets kube-delete-all