forked from wickett/word-cloud-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (49 loc) · 1.51 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
60
61
62
63
64
65
66
67
BINARY=word-cloud-generator
all: clean test build
lint: vet fmt
@echo "Linting finished using go vet && go fmt"
vet:
go vet $$(go list ./...|grep -v vendor)
fmt:
go fmt $$(go list ./...|grep -v vendor)
test:
@go test $$(go list ./...|grep -v vendor) -v
integration:
@curl -H "Content-Type: application/json" -d '{"text":"stars stars stars"}' http://localhost:8888/api | grep 3
run:
@go run main.go
start-mac: build
./artifacts/osx/word-cloud-generator
goconvey-install:
@go install github.com/smartystreets/goconvey
goconvey:
@goconvey -port=9999
build:
@echo "Creating compiled builds in ./artifacts"
@env GOOS=darwin GOARCH=amd64 go build -o ./artifacts/osx/${BINARY} -v .
@env GOOS=linux GOARCH=amd64 go build -o ./artifacts/linux/${BINARY} -v .
@env GOOS=windows GOARCH=amd64 go build -o ./artifacts/windows/${BINARY} -v .
@ls -lR ./artifacts
docker-build: build
@echo "Creating the docker on alpine linux"
docker build . -t word-cloud-generator
docker-run:
@echo "Starting new container of word-cloud-generator listening on localhost:8888"
docker run -it --rm -p 8888:8888 word-cloud-generator
clean:
@echo "Cleaning up previous builds"
@go clean
@rm -rf ./artifacts/*
install:
@echo "Installs to $$GOPATH/bin"
@go build ./main.go
@go install
uninstall:
@echo "Removing from $$GOPATH/bin"
@go clean -i
git-hooks:
test -d .git/hooks || mkdir -p .git/hooks
cp -f hooks/git-pre-commit.hook .git/hooks/pre-commit
chmod a+x .git/hooks/pre-commit
.PHONY: all install uninstall clean
.DEFAULT_GOAL := all