forked from moul/pipotron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (61 loc) · 1.69 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
68
69
70
71
72
73
74
75
DICTS := $(basename $(notdir $(wildcard dict/*.yml)))
GORELEASER_GITHUB_TOKEN ?=
GITHUB_TOKEN ?= $(GORELEASER_GITHUB_TOKEN)
DEPS := ./web/dicts.js ./dict/dict-packr.go
.PHONY: install
install: $(DEPS)
GO111MODULE=on go install
.PHONY: dev
dev: clean
GO111MODULE=on go install
cd web; browser-sync
./web/dicts.js: $(wildcard ./dict/*.yml)
cd dict; fs-bundler --format=js --callback=dicts *.yml > ../$@.tmp
mv $@.tmp $@
./dict/dict-packr.go: $(wildcard ./dict/*.go) $(wildcard ./dict/*.yml)
GO111MODULE=off go get github.com/gobuffalo/packr/v2/packr2
rm -f ./dict/*~
rm -f ./dict/.#*
rm -f ./dict/*#
packr2
.PHONY: examples
examples:
rm -rf examples
mkdir -p examples
for dict in $(DICTS); do \
for i in `seq 100`; \
do pipotron $$dict >> examples/$$dict.txt; \
done; \
done
.PHONY: clean
clean:
git clean -fxd
rm -f $(DEPS)
.PHONY: docker
docker:
docker build -t moul/pipotron .
.PHONY: functions
functions: $(DEPS)
mkdir -p functions-build
GO111MODULE=on go install
go build -o functions-build/pipotron ./functions/pipotron.go
.PHONY: goreleaser
goreleaser: $(DEPS)
GORELEASER_GITHUB_TOKEN=$(GORELEASER_GITHUB_TOKEN) GITHUB_TOKEN=$(GITHUB_TOKEN) goreleaser --rm-dist
.PHONY: goreleaser-dry-run
goreleaser-dry-run:
goreleaser --snapshot --skip-publish --rm-dist
.PHONY: _netlify_prepare
_netlify_prepare:
go get moul.io/fs-bundler
.PHONY: netlify-dev
netlify-dev:
netlify dev -c 'make dev'
.PHONY: sam-local
sam-local: $(DEPS)
@# pip install --user sam-aws-cli
@echo ""
@echo "Open: http://localhost:3000/index.html"
@echo ""
GO111MODULE=on GOOS=linux GOARCH=amd64 go build -o functions-build/pipotron ./functions/pipotron.go
sam local start-api --host=0.0.0.0 --static-dir=web