-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (35 loc) · 947 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
45
46
47
48
49
50
51
52
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOMOD=$(GOCMD) mod
BINARY_NAME=shopping-cart
DOCKER_IMAGE=shopping-cart
# For Development Build #################################################################
# Docker.io username and tag
DOCKER_USER=nikhilbarge
DOCKER_IMAGE_TAG=test
# For Development Build #################################################################
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
build:
$(GOBUILD) -o $(BINARY_NAME) -v
test:
$(GOTEST) -v ./...
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)
modverify:
$(GOMOD) verify
modtidy:
$(GOMOD) tidy
moddownload:
$(GOMOD) download
docker-build:
docker build -t $(DOCKER_USER)/$(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG) -f Dockerfile .
docker-push:
docker push $(DOCKER_USER)/$(DOCKER_IMAGE):$(DOCKER_IMAGE_TAG)
buildlocal: build docker-build clean
all: build docker-build docker-push