-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 862 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
-include .env
VERSION := $(shell git describe --tags)
PROJECTNAME := $(shell basename "$(PWD)")
LDFLAGS=-ldflags "-X=main.Version=$(VERSION)"
## build: Complie Golang files
build:
@echo " > Building binary..."
go build $(LDFLAGS) ./cmd/replica
## build: Complie Golang files
build-arm:
@echo " > Building arm 32bit binary..."
env GOOS=linux GOARCH=arm go build $(LDFLAGS) ./cmd/replica
## print-filters: Print filters
print-plugins:
./replica -sample-config -dist-filter "ssh:local" -bck-filter "targz"
## buildimage: Build docker image
buildimage:
@echo " > Building docker image..."
docker build -t $(PROJECTNAME) .
## test: Run test with verbose
test:
go test -v
.PHONY: help
all: help
help: Makefile
@echo
@echo " Choose a command run in "$(PROJECTNAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo