-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (37 loc) · 1.26 KB
/
Makefile
File metadata and controls
53 lines (37 loc) · 1.26 KB
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
53
.DEFAULT_GOAL := help
PROJECT_ROOT:=$(shell git rev-parse --show-toplevel)
REPO_URL := $(shell git config --get remote.origin.url)
COMMIT := $(shell git rev-parse --short HEAD)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
DATE := $(shell date +%Y-%m-%d-%H-%M-%S)
APP_NAME := $(shell basename `git rev-parse --show-toplevel`)
AWS_REGION ?= ap-southeast-2
GOOS ?= linux
GOARCH ?= amd64
CGO_ENABLED=0
# Load env properties , db name, port, etc.
# nb: You can change the default config with `make ENV_CONTEXT=".env.uat" `
ENV_CONTEXT ?= .env.local
ENV_CONTEXT_PATH:=$(PROJECT_ROOT)/$(ENV_CONTEXT)
## Override any default values in the parent .env, with your own
-include $(ENV_CONTEXT_PATH)
MAKE_LIB:=$(PROJECT_ROOT)/scripts
-include $(MAKE_LIB)/tests.mk
-include $(MAKE_LIB)/db.mk
-include $(MAKE_LIB)/lints.mk
-include $(MAKE_LIB)/logs.mk
-include $(MAKE_LIB)/tools.mk
GO_BUILD_FLAGS=-ldflags=""
#####################
##@ CI
#####################
ci: log test lint scan ## Run CI tasks
install-ci: tools-scan ## install tools for CI only
#####################
##@ Dev
#####################
build: ## build go files
go build $(GO_BUILD_FLAGS) -o $(APP_NAME)
install: tools-all ## install golang / node dependencies
generate: ## run go generation tools
go generate ./...