mirror of
https://github.com/umputun/reproxy.git
synced 2025-12-23 22:31:04 +02:00
* ci: modernize release automation with GoReleaser and multi-arch Docker builds - Add release.yml workflow for automatic binary publishing via GoReleaser - Add docker.yml workflow with parallel multi-arch builds (amd64/arm64) - Remove Docker build steps from ci.yml (now CI-only) - Add Homebrew tap configuration to goreleaser.yml - Remove obsolete Dockerfile.artifacts and Makefile dist target - Update README with Homebrew installation instructions * fix: use t.Context() in proxy tests to prevent goroutine leaks * chore: address review feedback - add fetch-depth and update checkout version * fix goroutine leak in mergeEvents and use t.Context() in tests the mergeEvents function could block forever when sending to the output channel after context cancellation. this caused test timeouts and potential production goroutine leaks. also replaced context.Background() with t.Context() in tests for proper cleanup on test completion. * fix flaky TestHttp_healthHandler test use assert.Eventually to wait for server readiness instead of fixed sleep. this makes the test more reliable on slow CI runners. * increase CI test timeout to 120s * fix flaky proxy tests with require.Eventually for server readiness replace 10ms sleep after h.Run() with require.Eventually polling to wait for server to accept connections. this fixes intermittent "connection refused" errors on slow CI runners.
27 lines
876 B
Makefile
27 lines
876 B
Makefile
B=$(shell git rev-parse --abbrev-ref HEAD)
|
|
BRANCH=$(subst /,-,$(B))
|
|
GITREV=$(shell git describe --abbrev=7 --always --tags)
|
|
REV=$(GITREV)-$(BRANCH)-$(shell date +%Y%m%d-%H:%M:%S)
|
|
|
|
docker:
|
|
docker build -t umputun/reproxy:master --progress=plain .
|
|
|
|
race_test:
|
|
cd app && go test -race -timeout=60s -count 1 ./...
|
|
|
|
build: info
|
|
- cd app && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.revision=$(REV) -s -w" -o ../dist/reproxy
|
|
|
|
site:
|
|
@rm -f site/public/*
|
|
docker build -f Dockerfile.site --progress=plain -t reproxy.site .
|
|
docker run -d --name=reproxy.site reproxy.site
|
|
docker cp reproxy.site:/build/public site/
|
|
docker rm -f reproxy.site
|
|
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./site/public/ reproxy.io:/srv/www/reproxy.io
|
|
|
|
info:
|
|
- @echo "revision $(REV)"
|
|
|
|
.PHONY: docker race_test build info site
|