docs: update docs

This commit is contained in:
2025-05-18 07:34:36 +02:00
parent 9e6fcbdd74
commit 032f3afdf3
2 changed files with 37 additions and 23 deletions

View File

@@ -4,17 +4,26 @@ ADDR ?= 0.0.0.0:8080
default: build
.PHONY: info
info:
@echo "Available targets:"
@grep '^##' Makefile | sed 's/^##//'
## generate: Generate Swagger Spec
generate:
swagger generate server -f api/rcond.yaml -t api/
go mod tidy
## test: run tests
test:
go test -v ./...
## build: build binary for target $ARCH
build:
mkdir -p bin
env GOOS=linux GOARCH=${ARCH} go build -o bin/rcond-${ARCH} ./cmd/rcond/main.go
## install: build and install binary for target $ARCH as systemd service
install: build
sudo mkdir -p /etc/rcond
sudo mkdir -p /var/rcond
@@ -25,6 +34,7 @@ install: build
sudo systemctl enable rcond
sudo systemctl start rcond
## uninstall: uninstall systemd service
uninstall:
sudo systemctl stop rcond
sudo systemctl disable rcond
@@ -33,14 +43,18 @@ uninstall:
sudo rm /usr/local/bin/rcond
sudo rm /etc/systemd/system/rcond.service
## run: run and build binary for target $ARCH
run: build
bin/rcond-${ARCH} -config config/rcond.yaml
## dev: run go programm
dev:
go run cmd/rcond/main.go -config config/rcond.yaml
## dev-agent: run go programm with agent config
dev-agent:
go run cmd/rcond/main.go -config config/rcond-agent.yaml
## upload: upload binary of given $ARCH to rpi-test
upload:
scp bin/rcond-${ARCH} pi@192.168.1.43:/home/pi/rcond
scp bin/rcond-${ARCH} pi@rpi-test:/home/pi/rcond