🔍 yarns is a Search Engine for Twtxt https://search.twtxt.net/
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.
 
 
 
 
 
 

50 lines
1.3 KiB

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