-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (32 loc) · 981 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
31
32
33
34
35
36
37
38
39
VERSION ?= $(shell git rev-parse --short HEAD)
DOCKER_IMAGE_NAME := quay.io/arschles/goprox:${VERSION}
# dockerized development environment variables
REPO_PATH := github.com/arschles/goprox
DEV_ENV_IMAGE := quay.io/deis/go-dev:v0.22.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}
SERVER_BUILD_CMD := go build -o cmd/server/goproxd ./cmd/server
CLI_BUILD_CMD := go build -o cmd/cli/goprox ./cmd/cli
build:
ifdef DOCKER
${DEV_ENV_CMD} ${CLI_BUILD_CMD}
${DEV_ENV_CMD} ${SERVER_BUILD_CMD}
else
${CLI_BUILD_CMD}
${SERVER_BUILD_CMD}
endif
docker-build:
@echo "nothing to do yet"
# docker build --rm -t ${DOCKER_IMAGE_NAME} rootfs
docker-push:
@echo "nothing to do yet"
# docker push ${DOCKER_IMAGE_NAME}
test:
ifdef DOCKER
${DEV_ENV_CMD} sh -c 'go test $$(glide nv)'
else
go test $$(glide nv)
endif
codegen:
make -C ./_proto codegen