-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
43 lines (34 loc) · 1.06 KB
/
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
EXECUTABLE := buyte
VERSION := 1.0.0
PACKAGENAME := $(shell go list -f '{{ .ImportPath }}')
.PHONY: default
default: ${EXECUTABLE}
.PHONY: init
init:
curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s
.PHONY: clean
clean:
rm -rf /usr/local/bin/${EXECUTABLE} ./bin ./vendor
.PHONY: build
build: dep
go build -o bin/${EXECUTABLE} *.go
.PHONY: container-build
container-build:
GOOS=linux GOARCH=amd64 go build -ldflags '-s -w -X "${PACKAGENAME}/conf.Executable=${EXECUTABLE}" -X "${PACKAGENAME}/conf.Version=${VERSION}"' -o ./bin/${EXECUTABLE}
.PHONY: ${EXECUTABLE}
${EXECUTABLE}:
# Compiling...
go build -ldflags '-X "${PACKAGENAME}/conf.Executable=${EXECUTABLE}" -X "${PACKAGENAME}/conf.Version=${VERSION}"' -o bin/${EXECUTABLE}
chmod +x bin/${EXECUTABLE}
rm -rf /usr/local/bin/${EXECUTABLE}
ln -s $(shell echo $(CURDIR))/bin/${EXECUTABLE} /usr/local/bin/${EXECUTABLE}
.PHONY: watch
watch:
./bin/air -c ./.air.conf
.PHONY: sls-build
sls-build:
sls build
sls create_domain
.PHONY: sls-deploy
sls-deploy: sls-build
sls deploy --verbose