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.
58 lines
1.6 KiB
58 lines
1.6 KiB
PROJECT_NAME=relay
|
|
GITHUB_TOKEN=
|
|
|
|
.DEFAULT_GOAL := test
|
|
|
|
build-snapshot: export GPG_FINGERPRINT=922248E5D4629F2284964DB103B64DFCECF2BE40
|
|
build-snapshot: clean
|
|
goreleaser release --snapshot
|
|
|
|
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 build --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
|
|
|
|
new-migration: export BUN_TIMESTAMP=$(shell date +%Y%m%d%H%M%S | head -c 14)
|
|
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
|
|
|
|
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 clean docker-pull docker-restart docker-start docker-stop fmt i18n-extract new-migration release stage-static test test-ext test-bench-ext tidy vendor
|