This repository has been archived by the owner on May 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (29 loc) · 1.45 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
GOMOD=$(shell test -f "go.work" && echo "readonly" || echo "vendor")
LDFLAGS=-s -w
cli:
go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o bin/whosonfirst-browser cmd/whosonfirst-browser/main.go
debug:
# @make cli
./bin/whosonfirst-browser \
-enable-all \
-map-provider tangram \
-nextzen-apikey $(APIKEY) \
-reader-uri $(READER)
debug-tilepack:
make cli && bin/whosonfirst-browser -enable-all -nextzen-tilepack-database $(TILEPACK) -reader-uri $(READER)
debug-docker:
docker run -it -p 8080:8080 whosonfirst-browser /usr/local/bin/whosonfirst-browser -server-uri 'http://0.0.0.0:8080' -enable-all -nextzen-api-key $(APIKEY)
lambda:
@make lambda-browser
lambda-browser:
if test -f bootstrap; then rm -f bootstrap; fi
if test -f browser.zip; then rm -f browser.zip; fi
GOARCH=arm64 GOOS=linux go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -tags lambda.norpc -o bootstrap cmd/whosonfirst-browser/main.go
zip browser.zip bootstrap
rm -f bootstrap
docker:
docker build -t whosonfirst-browser .
bump-version:
perl -i -p -e 's/github.com\/whosonfirst\/go-whosonfirst-browser\/$(PREVIOUS)/github.com\/whosonfirst\/go-whosonfirst-browser\/$(NEW)/g' go.mod
perl -i -p -e 's/github.com\/whosonfirst\/go-whosonfirst-browser\/$(PREVIOUS)/github.com\/whosonfirst\/go-whosonfirst-browser\/$(NEW)/g' README.md
find . -name '*.go' | xargs perl -i -p -e 's/github.com\/whosonfirst\/go-whosonfirst-browser\/$(PREVIOUS)/github.com\/whosonfirst\/go-whosonfirst-browser\/$(NEW)/g'