Skip to content

Commit a09737a

Browse files
author
Aaron Schlesinger
committed
fix(Makefile): build Go code inside docker containers
1 parent faf9cb6 commit a09737a

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

client/Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ export GO15VENDOREXPERIMENT=1
33
# the filepath to this repository, relative to $GOPATH/src
44
repo_path = github.com/deis/workflow/client
55

6+
DEV_ENV_IMAGE := quay.io/deis/go-dev:0.4.0
7+
DEV_ENV_WORK_DIR := /go/src/${repo_path}
8+
DEV_ENV_PREFIX := docker run --rm -e GO15VENDOREXPERIMENT=1 -e CGO_ENABLED=0 -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
9+
DEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}
10+
611
GO_FILES = $(wildcard *.go)
712
GO_PACKAGES = cmd controller/api controller/client $(wildcard controller/models/*) parser $(wildcard pkg/*)
813
GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES))
@@ -19,10 +24,13 @@ define check-static-binary
1924
endef
2025

2126
bootstrap:
22-
glide -y glide.yaml install
27+
${DEV_ENV_CMD} glide install
28+
29+
glideup:
30+
${DEV_ENV_CMD} glide up
2331

2432
build:
25-
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' -o deis .
33+
${DEV_ENV_CMD} go build -a -installsuffix cgo -ldflags '-s' -o deis .
2634
@$(call check-static-binary,deis)
2735

2836
install: build

0 commit comments

Comments
 (0)