-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (28 loc) · 780 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
#!make
all: build
TAG?=$(shell bash -c 'git log --pretty=format:'%h' -n 1')
FLAGS=
ENVVAR=
GOOS?=darwin
REGISTRY?=686244538589.dkr.ecr.us-east-2.amazonaws.com
BASEIMAGE?=alpine:3.9
#BUILD_NUMBER=$$(date +'%Y%m%d-%H%M%S')
BUILD_NUMBER := $(shell bash -c 'echo $$(date +'%Y%m%d-%H%M%S')')
ENV_FILE?=scripts/dev-conf/envfile.env
include $(ENV_FILE)
export
build: clean wire
$(ENVVAR) GOOS=$(GOOS) go build -o devtron
wire:
wire
clean:
rm -f devtron
run: build
./devtron
.PHONY: build
docker-build-image: build
docker build -t devtron:$(TAG) .
.PHONY: build, all, wire, clean, run, set-docker-build-env, docker-build-push, devtron,
docker-build-push: docker-build-image
docker tag devtron:${TAG} ${REGISTRY}/devtron:${TAG}
docker push ${REGISTRY}/devtron:${TAG}