-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
24 lines (19 loc) · 724 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
SHELL=/bin/bash
BIN:=gloo-oss-extauth
.SILENT: ; # No need for @
.ONESHELL: ; # Single shell for a target (required to properly use local variables)
.PHONY: clean build image
.DEFAULT_GOAL := build
clean:
rm -f target/*
build: clean # run 'make build OFFLINE=true' to build from vendor folder
if [ -z ${OFFLINE} ] || [ ${OFFLINE} != true ];then \
echo "Building ..."; \
GOOS=linux GOARCH=amd64 go build -mod=mod -a -o target/$(BIN) ./cmd; \
else \
echo "Building using local vendor folder (ie offline build) ..."; \
GOOS=linux GOARCH=amd64 go build -mod=vendor -a -o target/$(BIN) ./cmd; \
fi
image:
echo "Build image using Go container and multi-stage build ..."
docker build -t asaintsever/$(BIN) .