-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (49 loc) · 1.91 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Include variables from the .envrc file
include .envrc
# ================================================================================ #
# HELPERS
# ================================================================================ #
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
# ================================================================================ #
# QUALITY CONTROL
# ================================================================================ #
## audit: tidy dependencies and form, vet and test all code
.PHONY: audit
audit: vendor
@echo 'Formatting code...'
go fmt ./...
@echo 'Vetting code...'
go vet ./...
@echo 'Running tests...'
go test -vet=off ./...
.PHONY: vendor
vendor:
@echo 'Tidying and verifying module dependencies...'
go mod tidy
go mod verify
@echo 'Vendoring dependencies...'
go mod vendor
# ================================================================================ #
# BUILD
# ================================================================================ #
## build: builds the usesthisreader binary
.PHONY: build
build: audit
@echo 'Building cmd/usesthisreader...'
go build -o=./bin/usesthisreader ./cmd/usesthisreader
GOOS=linux GOARCH=arm go build -o=./bin/linux_arm/usesthisreader ./cmd/usesthisreader
## docker: builds container image
.PHONY: docker
docker: build
docker build -f ./docker/Dockerfile -t utr:0.0.1 .
# ================================================================================ #
# RUN
# ================================================================================ #
## run: runs the application as a docker container locally
.PHONY: run
run: docker
docker run -d -v ${LOCAL_STORAGE_MOUNT_PATH}:/home/usesthisreader/.aws/ -e EXEC_PERIOD=${EXEC_PERIOD} -e RECIPIENT=${RECIPIENT} -e SENDER=${SENDER} -e LOCAL_STORAGE_PATH=${LOCAL_STORAGE_PATH} utr:0.0.1