relay/Makefile
2022-09-01 13:59:04 -07:00

56 lines
1.5 KiB
Makefile

PROJECT_NAME=relay
.DEFAULT_GOAL := test
build-snapshot: export GPG_FINGERPRINT=922248E5D4629F2284964DB103B64DFCECF2BE40
build-snapshot: clean
goreleaser release --snapshot
bun-new-migration: export BUN_TIMESTAMP=$(shell date +%Y%m%d%H%M%S | head -c 14)
bun-new-migration:
touch internal/db/bun/migrations/${BUN_TIMESTAMP}_new.go
cat internal/db/bun/migrations/migration.go.tmpl > internal/db/bun/migrations/${BUN_TIMESTAMP}_new.go
clean:
@echo cleaning up workspace
@rm -Rvf .cache coverage.txt dist relay
@find . -name ".DS_Store" -exec rm -v {} \;
docker-pull:
docker-compose --project-name ${PROJECT_NAME} -f deployments/docker-compose-test.yaml pull
docker-restart: docker-stop docker-start
docker-start:
docker-compose --project-name ${PROJECT_NAME} -f deployments/docker-compose-test.yaml up -d
docker-stop:
docker-compose --project-name ${PROJECT_NAME} -f deployments/docker-compose-test.yaml down
fmt:
@echo formatting
@go fmt $(shell go list ./... | grep -v /vendor/)
i18n-extract:
goi18n extract -format yaml -outdir web/locales -crowdin
release: clean
goreleaser release
test: tidy fmt
go test -cover ./...
test-ext: tidy fmt
go test --tags=postgres -cover ./...
test-bench-ext: tidy fmt
go test -run=XXX -bench=. --tags=postgres -cover ./...
tidy:
go mod tidy
vendor: tidy
go mod vendor
.PHONY: build-snapshot bun-new-migration clean docker-pull docker-restart docker-start docker-stop fmt i18n-extract release stage-static test test-ext test-bench-ext tidy vendor