-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
46 lines (32 loc) · 1.1 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
SHORT_NAME := minio
# dockerized development environment variables
REPO_PATH := github.com/deis/${SHORT_NAME}
DEV_ENV_IMAGE := quay.io/deis/go-dev:0.20.0
DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
DEV_ENV_PREFIX := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
DEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}
LDFLAGS := "-s -X main.version=${VERSION}"
BINDIR := ./rootfs/bin
DEV_REGISTRY ?= $(docker-machine ip deis):5000
DEIS_REGISTRY ?= ${DEV_REGISTRY}
IMAGE_PREFIX ?= deis
include versioning.mk
TEST_PACKAGES := $(shell ${DEV_ENV_CMD} glide nv)
all: build docker-build docker-push
bootstrap:
${DEV_ENV_CMD} glide install
glideup:
${DEV_ENV_CMD} glide up
build:
mkdir -p ${BINDIR}
${DEV_ENV_CMD} go build -ldflags '-s' -o $(BINDIR)/boot boot.go || exit 1
test:
${DEV_ENV_CMD} go test ${TEST_PACKAGES}
test-cover:
${DEV_ENV_CMD} test-cover.sh
docker-build: build
# build the main image
docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} rootfs
docker tag ${IMAGE} ${MUTABLE_IMAGE}
deploy: build docker-build docker-push
.PHONY: all bootstrap glideup build test docker-build deploy