From 7578349442958c363005f3e003b4c576b074ff3a Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Mon, 24 Feb 2025 13:11:08 -0500 Subject: [PATCH 1/3] Add swag to builddeps in installation.md --- README.md | 3 ++- doc/installation.md | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 245d158..4893172 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,9 @@ Otherwise, install build dependencies. Go 1.19 or later is required: ``` sudo apt install make golang gcc nodejs npm # Debian -sudo dnf install make go gcc nodejs npm # Fedora +sudo dnf install make golang gcc nodejs npm # Fedora sudo pacman -S make go gcc nodejs npm # Arch Linux + go install github.com/swaggo/swag/cmd/swag@latest ``` diff --git a/doc/installation.md b/doc/installation.md index 74f8d98..e6fd3dc 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -138,8 +138,10 @@ This is a more declarative version of the Docker setup from above. ``` sudo apt install make golang gcc nodejs npm # Debian - sudo dnf install make go gcc nodejs npm # Fedora + sudo dnf install make golang gcc nodejs npm # Fedora sudo pacman -S make go gcc nodejs npm # Arch Linux + + go install github.com/swaggo/swag/cmd/swag@latest ``` 2. Clone the repository: From 0460a7212148433b9685c8086c0ae042db142b2f Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Thu, 27 Feb 2025 20:24:00 -0500 Subject: [PATCH 2/3] Use 'go run' for swag in Makefile if not on PATH --- Makefile | 5 ++++- README.md | 2 -- doc/installation.md | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index de15f36..1903772 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,14 @@ prefix ?= /usr .DEFAULT_GOAL := build +# TODO probably use `go tool` for this eventually +SWAG := $(shell command -v swag || echo 'go run github.com/swaggo/swag/cmd/swag@v1.16.4') + npm-install: npm install swag: - swag init --generalInfo api.go --output . --outputTypes json + $(SWAG) init --generalInfo api.go --output . --outputTypes json prebuild: npm-install swag node esbuild.config.js diff --git a/README.md b/README.md index 4893172..c548977 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,6 @@ Otherwise, install build dependencies. Go 1.19 or later is required: sudo apt install make golang gcc nodejs npm # Debian sudo dnf install make golang gcc nodejs npm # Fedora sudo pacman -S make go gcc nodejs npm # Arch Linux - -go install github.com/swaggo/swag/cmd/swag@latest ``` Then build the program with: diff --git a/doc/installation.md b/doc/installation.md index e6fd3dc..c3a1e08 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -140,8 +140,6 @@ This is a more declarative version of the Docker setup from above. sudo apt install make golang gcc nodejs npm # Debian sudo dnf install make golang gcc nodejs npm # Fedora sudo pacman -S make go gcc nodejs npm # Arch Linux - - go install github.com/swaggo/swag/cmd/swag@latest ``` 2. Clone the repository: From a01ce6b0324530ccb3129bff8c45f2370ebaf0c3 Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Thu, 27 Feb 2025 20:27:16 -0500 Subject: [PATCH 3/3] installation.md: recommend building not as root --- doc/installation.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/installation.md b/doc/installation.md index c3a1e08..eb36200 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -150,7 +150,12 @@ This is a more declarative version of the Docker setup from above. cd drasl ``` -3. `sudo make install` +3. Build and install: + + ``` + make + sudo make install + ``` 4. Create `/etc/drasl/config.toml` and fill it out according to one of the examples in [doc/recipes.md](recipes.md).