2022-04-26 21:50:00 +00:00
|
|
|
PROJECT_NAME=relay
|
|
|
|
|
|
|
|
.DEFAULT_GOAL := test
|
|
|
|
|
2022-08-27 21:35:53 +00:00
|
|
|
build-snapshot: export GPG_FINGERPRINT=922248E5D4629F2284964DB103B64DFCECF2BE40
|
2022-04-26 21:50:00 +00:00
|
|
|
build-snapshot: clean
|
2022-08-27 21:35:53 +00:00
|
|
|
goreleaser release --snapshot
|
2022-04-26 21:50:00 +00:00
|
|
|
|
|
|
|
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
|
2022-07-27 04:33:36 +00:00
|
|
|
@rm -Rvf .cache coverage.txt dist relay
|
2022-04-26 21:50:00 +00:00
|
|
|
@find . -name ".DS_Store" -exec rm -v {} \;
|
|
|
|
|
2022-09-01 20:59:04 +00:00
|
|
|
docker-pull:
|
|
|
|
docker-compose --project-name ${PROJECT_NAME} -f deployments/docker-compose-test.yaml pull
|
|
|
|
|
2022-07-18 03:41:04 +00:00
|
|
|
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
|
|
|
|
|
2022-04-26 21:50:00 +00:00
|
|
|
fmt:
|
|
|
|
@echo formatting
|
|
|
|
@go fmt $(shell go list ./... | grep -v /vendor/)
|
|
|
|
|
|
|
|
i18n-extract:
|
2022-08-16 23:08:42 +00:00
|
|
|
goi18n extract -format yaml -outdir web/locales -crowdin
|
2022-04-26 21:50:00 +00:00
|
|
|
|
2022-07-27 04:49:47 +00:00
|
|
|
release: clean
|
|
|
|
goreleaser release
|
|
|
|
|
2022-09-01 20:59:04 +00:00
|
|
|
test: tidy fmt
|
2022-04-26 21:50:00 +00:00
|
|
|
go test -cover ./...
|
|
|
|
|
2022-09-01 20:59:04 +00:00
|
|
|
test-ext: tidy fmt
|
2022-04-26 21:50:00 +00:00
|
|
|
go test --tags=postgres -cover ./...
|
|
|
|
|
2022-09-01 20:59:04 +00:00
|
|
|
test-bench-ext: tidy fmt
|
2022-04-26 21:50:00 +00:00
|
|
|
go test -run=XXX -bench=. --tags=postgres -cover ./...
|
|
|
|
|
|
|
|
tidy:
|
|
|
|
go mod tidy
|
|
|
|
|
|
|
|
vendor: tidy
|
|
|
|
go mod vendor
|
|
|
|
|
2022-09-01 20:59:04 +00:00
|
|
|
.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
|