forked from deis/minio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (48 loc) · 1.83 KB
/
Makefile
File metadata and controls
66 lines (48 loc) · 1.83 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
SHORT_NAME := minio
export GO15VENDOREXPERIMENT=1
# Note that Minio currently uses CGO.
VERSION := 0.0.1-$(shell date "+%Y%m%d%H%M%S")
LDFLAGS := "-s -X main.version=${VERSION}"
BINDIR := ./rootfs/bin
DEV_REGISTRY ?= $(docker-machine ip deis):5000
DEIS_REGISTRY ?= ${DEV_REGISTRY}
RC := manifests/deis-${SHORT_NAME}-rc.yaml
SVC := manifests/deis-${SHORT_NAME}-service.yaml
SEC := manifests/deis-${SHORT_NAME}-secretAdmin.yaml
IMAGE := ${DEIS_REGISTRY}/${SHORT_NAME}:${VERSION}
all: build docker-build docker-push
bootstrap:
glide up
build:
mkdir -p ${BINDIR}
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' -o $(BINDIR)/boot boot.go || exit 1
docker-build:
docker build -t minio mc
docker cp `docker run -d minio`:/go/bin/minio $(BINDIR)
docker build --rm -t ${IMAGE} rootfs
# These are both YAML specific
perl -pi -e "s|image: [a-z0-9.:]+\/deis\/${SHORT_NAME}:[0-9a-z-.]+|image: ${IMAGE}|g" ${RC}
perl -pi -e "s|release: [a-zA-Z0-9.+_-]+|release: ${VERSION}|g" ${RC}
docker-push:
docker push ${IMAGE}
deploy: build docker-build docker-push kube-rc
kube-rc: kube-service
kubectl create -f ${RC}
kube-secrets:
- kubectl create -f ${SEC}
secrets:
perl -pi -e "s|access-key-id: .+|access-key-id: ${key}|g" ${SEC}
perl -pi -e "s|access-secret-key: .+|access-secret-key: ${secret}|g" ${SEC}
echo ${key} ${secret}
kube-service: kube-secrets
- kubectl create -f ${SVC}
- kubectl create -f manifests/deis-minio-secretUser.yaml
kube-clean:
- kubectl delete rc deis-${SHORT_NAME}-rc
kube-mc:
kubectl create -f manifests/deis-mc-pod.yaml
mc:
docker build -t ${DEIS_REGISTRY}/deis/minio-mc:latest mc
docker push ${DEIS_REGISTRY}/deis/minio-mc:latest
perl -pi -e "s|image: [a-z0-9.:]+\/|image: ${DEIS_REGISTRY}/|g" manifests/deis-mc-pod.yaml
.PHONY: all build docker-compile kube-up kube-down deploy mc kube-mc