-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmakefile
50 lines (40 loc) · 1.41 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
VERSION := $(shell git describe --always --long --dirty --tags)
CLEAN := $(shell git describe --tags)
all: install
fetch:
@go get -u github.com/stretchr/testify
@go get -u ./...
build:
@echo Building to current folder
go build -v -ldflags="-X main.version=${VERSION}"
build_windows:
@echo Building for Windows to current folder
env GOOS=windows GOARCH=amd64 go build -v -ldflags="-X main.version=${VERSION}" -o cascade.exe
install: build
@echo Installing to ${GOPATH}/bin
go install
test: fetch
@echo Running tests
go test
go test github.com/azak-azkaran/cascade/utils
coverage: fetch
@echo Running Test with Coverage export
go test github.com/azak-azkaran/cascade github.com/azak-azkaran/cascade/utils -v -coverprofile=cover.out -covermode=count
go test github.com/azak-azkaran/cascade github.com/azak-azkaran/cascade/utils -json > report.json
coverall: coverage
@echo Running Test with Coverall
goveralls -coverprofile=cover.out -service=travis-ci -repotoken=${COVERALLS_TOKEN }
daemon: build
@echo Moving cascade to /usr/local/bin
mv ./cascade /usr/local/bin/
@echo Copying config to /etc/systemd/system/cascade.service
cp ./cascade.service /etc/systemd/system/cascade.service
@echo restarting systemd
systemctl daemon-reload
@echo starting cascade as daemon
systemctl start cascade
release: build
@echo creating zip
tar -czvf ~/cascade.v${CLEAN}.tar.gz cascade README.md cascade.service
clean:
go clean