| 1234567891011121314151617181920212223242526272829303132333435 |
- BINARY_NAME=proxmox-router
- BUILD_DIR=bin
- GO=go
- .PHONY: all build clean run install test
- all: build
- build:
- @echo "Building $(BINARY_NAME)..."
- @mkdir -p $(BUILD_DIR)
- CGO_ENABLED=0 $(GO) build -ldflags="-s -w" -o $(BUILD_DIR)/$(BINARY_NAME) cmd/server/main.go
- CGO_ENABLED=0 $(GO) build -ldflags="-s -w" -o $(BUILD_DIR)/debtik-cli ./cmd/debtik-cli
- @echo "Build complete: $(BUILD_DIR)/$(BINARY_NAME)"
- run: build
- ./$(BUILD_DIR)/$(BINARY_NAME) -addr :8080
- install: build
- @echo "Installing $(BINARY_NAME) to /usr/local/bin/..."
- cp $(BUILD_DIR)/$(BINARY_NAME) /usr/local/bin/$(BINARY_NAME)
- cp $(BUILD_DIR)/debtik-cli /usr/local/bin/debtik-cli
- chmod +x /usr/local/bin/$(BINARY_NAME) /usr/local/bin/debtik-cli
- @mkdir -p /etc/proxmox-router /etc/network/interfaces.d
- cp systemd/proxmox-router.service /etc/systemd/system/proxmox-router.service
- systemctl daemon-reload
- systemctl enable --now proxmox-router
- @echo "Installed and started service proxmox-router successfully!"
- clean:
- rm -rf $(BUILD_DIR)
- test:
- $(GO) test ./...
- node --test scripts/ui-regression.test.cjs
|