feat: publish standalone worker
Separate worker packaging and service lifecycle from the control plane.
Этот коммит содержится в:
43
Makefile
Обычный файл
43
Makefile
Обычный файл
@@ -0,0 +1,43 @@
|
||||
BINARY := bin/rsmon-worker
|
||||
VERSION ?= dev
|
||||
COMMIT ?= $(shell git rev-parse --short=12 HEAD 2>/dev/null || printf unknown)
|
||||
BUILD_DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
LDFLAGS := -s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.buildDate=$(BUILD_DATE)
|
||||
|
||||
.PHONY: build test check image clean
|
||||
|
||||
build:
|
||||
mkdir -p bin
|
||||
CGO_ENABLED=0 go build -trimpath -ldflags="$(LDFLAGS)" -o $(BINARY) ./cmd/rsmon-worker
|
||||
|
||||
test:
|
||||
RSMON_ENV=test CWD=$(CURDIR) go test \
|
||||
./internal/distworker \
|
||||
./internal/webapp \
|
||||
./internal/workercluster \
|
||||
./internal/wire \
|
||||
./internal/checkexec \
|
||||
./checks/calls \
|
||||
./checks/cbssl \
|
||||
./checks/cdns \
|
||||
./checks/cftp \
|
||||
./checks/chttp \
|
||||
./checks/cping \
|
||||
./checks/cssh \
|
||||
./checks/cssl \
|
||||
./checks/ctcp \
|
||||
./checks/cudp \
|
||||
./checks/cwhois \
|
||||
./checks/llmhttp
|
||||
|
||||
check:
|
||||
go mod tidy
|
||||
git diff --exit-code -- go.mod go.sum
|
||||
$(MAKE) test
|
||||
$(MAKE) build
|
||||
|
||||
image:
|
||||
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) --build-arg BUILD_DATE=$(BUILD_DATE) -t rsmon-worker:local .
|
||||
|
||||
clean:
|
||||
rm -rf bin dist
|
||||
Ссылка в новой задаче
Block a user