This commit is contained in:
2026-01-06 10:20:34 -08:00
parent 0e1fc6a88d
commit a8ab26752a
15 changed files with 1806 additions and 929 deletions
+32 -9
View File
@@ -1,17 +1,40 @@
default: run
.PHONY: test lint fmt build run-local clean all copy run
main.go:
pbpaste > main.go
# Default target
default: test
copy: main.go
ssh root@las1stor1 -v "mkdir -p /tmp/x"
scp ./main.go root@las1stor1:/tmp/x
# Build the binary
build:
go build -o rtnetmon ./cmd/rtnetmon
run: copy
ssh -t root@las1stor1 -v "cd /tmp/x && go run ."
# Run tests
test: lint
go test -v ./...
# Run linter
lint:
golangci-lint run
# Format code
fmt:
go fmt ./...
# Run the application locally
run-local: build
./rtnetmon
# Clean build artifacts
clean:
rm main.go
rm -f rtnetmon
rm -f main.go.old
# Build and test everything
all: fmt lint test build
# Remote deployment targets
copy:
ssh root@las1stor1 -v "mkdir -p /tmp/x"
rsync -av --exclude='.git' --exclude='*.test' --exclude='/rtnetmon' --exclude='main.go.old' ./ root@las1stor1:/tmp/x/
run: copy
ssh -t root@las1stor1 -v "cd /tmp/x && go run ./cmd/rtnetmon"