-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (35 loc) · 762 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
37
38
39
40
41
42
43
44
-include .env
VERSION:=2.2.0
DOCKER_REPO_USER=chiefy
DOCKER_IMAGE_NAME=$(DOCKER_REPO_USER)/$(binary):$(VERSION)
project:=$(shell basename $(shell pwd))
commit:=$(shell git rev-parse --short HEAD)
importpath:=github.com/chiefy/$(project)
ts:=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
binary:=slashmovie
.PHONY: build
build: $(binary)
$(binary):
go build \
-ldflags \
"-s \
-w \
-X main.Version=$(VERSION) \
-X main.Commit=$(commit) \
-X main.Date=$(ts)" \
-o $(binary) .
.PHONY: local-proxy
local-proxy:
@ngrok http $(PORT)
.PHONY: clean
clean:
@-rm -f $(binary)
.PHONY: run
run: $(binary)
@./$(binary)
.PHONY: build-docker
build-docker:
docker build -t $(DOCKER_IMAGE_NAME) .
.PHONY: push-docker
push-docker:
@docker push $(DOCKER_IMAGE_NAME)