initial
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user