A privacy first search engine.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
1.4 KiB

.PHONY: deps dev build install image test clean
CGO_ENABLED=0
VERSION=$(shell git describe --abbrev=0 --tags 2>/dev/null || echo "$VERSION")
COMMIT=$(shell git rev-parse --short HEAD || echo "$COMMIT")
all: build
deps:
@go install github.com/GeertJohan/go.rice/rice@latest
@go install github.com/tdewolff/minify/cmd/minify@latest
dev : DEBUG=1
dev : build
@./spyda -D
server: generate
@go build -tags "netgo static_build" -installsuffix netgo \
-ldflags "-w \
-X $(shell go list).Version=$(VERSION) \
-X $(shell go list).Commit=$(COMMIT)" \
./cmd/spyda/...
build: server
generate:
@if [ x"$(DEBUG)" = x"1" ]; then \
echo 'Running in debug mode...'; \
rm -f -v ./internal/rice-box.go; \
else \
minify -o ./internal/static/css/spyda.min.css ./internal/static/css/[0-9]*-*.css; \
minify -o ./internal/static/js/spyda.min.js ./internal/static/js/[0-9]*-*.js; \
rm -f ./internal/rice-box.go; \
rice -i ./internal embed-go; \
fi
install: build
@go install ./cmd/spyda/...
ifeq ($(PUBLISH), 1)
image:
@docker build --build-arg VERSION="$(VERSION)" --build-arg COMMIT="$(COMMIT)" -t r.mills.io/prologic/spyda .
@docker push r.mills.io/prologic/spyda
else
image:
@docker build --build-arg VERSION="$(VERSION)" --build-arg COMMIT="$(COMMIT)" -t r.mills.io/prologic/spyda .
endif
test:
@go test -v -cover -race ./...
clean:
@git clean -f -d -X