-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (24 loc) · 853 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
VERSION ?= $(shell git describe --tags)
IMAGE = yieldr/aws-vpc-hosts-daemon
PKG = github.com/yieldr/aws-vpc-hosts-daemon
OS ?= darwin
ARCH ?= amd64
GOBUILDFLAGS = -a -tags netgo -ldflags '-w'
build:
GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/aws-vpc-hosts-daemon $(GOBUILDFLAGS)
test:
go test
docker-all: docker-build docker-image docker-push
docker-build:
@docker run -i --rm -v "$(PWD):/go/src/$(PKG)" $(IMAGE):build make build OS=linux
docker-test:
@docker run -i --rm -v "$(PWD):/go/src/$(PKG)" $(IMAGE):build make test
docker-image:
@docker build -t $(IMAGE):$(VERSION) .
@docker tag $(IMAGE):$(VERSION) $(IMAGE):latest
@echo " ---> $(IMAGE):$(VERSION)\n ---> $(IMAGE):latest"
docker-push:
@docker push $(IMAGE):$(VERSION)
@docker push $(IMAGE):latest
docker-builder-image:
@docker build -t $(IMAGE):build -f Dockerfile.build .