forked from flowcommerce/aws-credentials-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (23 loc) · 801 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
.PHONY: all install-dependencies build
APPLICATION_ID=aws-credentials-broker
ORG_PATH=github.com/flowcommerce
REPO_PATH=$(ORG_PATH)/$(APPLICATION_ID)
export PATH := $(PWD)/bin:$(PATH)
VERSION ?= $(shell git describe --tags --dirty --always | sed -e 's/^v//g')
BIN_NAME=dist/${APPLICATION_ID}
DOCKER_IMAGE=flowcommerce/$(APPLICATION_ID):$(VERSION)
export GOBIN=$(PWD)/bin
all: install-dependencies build
install-dependencies:
@dep ensure -vendor-only
.PHONY: release-binary
release-binary: install-dependencies
@go build -o /go/bin/$(APPLICATION_ID) -v $(REPO_PATH)
build:
go build -o ${BIN_NAME}
@echo "You can now use ./${BIN_NAME}"
docker-build:
docker build --no-cache -t $(DOCKER_IMAGE) --build-arg VERSION=$(VERSION) .
push:
docker push $(DOCKER_IMAGE)
deploy: docker-build push