mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
add makefile
This commit is contained in:
28
readme.md
28
readme.md
@@ -258,13 +258,31 @@ Pausing/unpausing the agent for longer than one minute will result in incomplete
|
||||
|
||||
Both the hub and agent are written in Go, so you can easily build them yourself, or cross-compile for different platforms. Please [install Go](https://go.dev/doc/install) first if you haven't already.
|
||||
|
||||
### Prepare dependencies
|
||||
### Using Makefile
|
||||
|
||||
Run `make` in `/beszel`. This creates a `build` directory containing the binaries.
|
||||
|
||||
```bash
|
||||
cd beszel && make
|
||||
```
|
||||
|
||||
You can also build for different platforms:
|
||||
|
||||
```bash
|
||||
make OS=freebsd ARCH=arm64
|
||||
```
|
||||
|
||||
See a list of valid options by running `go tool dist list`.
|
||||
|
||||
### Manual compilation
|
||||
|
||||
#### Prepare dependencies
|
||||
|
||||
```bash
|
||||
cd beszel && go mod tidy
|
||||
```
|
||||
|
||||
### Agent
|
||||
#### Agent
|
||||
|
||||
Go to `beszel/cmd/agent` and run the following command to create a binary in the current directory:
|
||||
|
||||
@@ -272,7 +290,7 @@ Go to `beszel/cmd/agent` and run the following command to create a binary in the
|
||||
CGO_ENABLED=0 go build -ldflags "-w -s" .
|
||||
```
|
||||
|
||||
### Hub
|
||||
#### Hub
|
||||
|
||||
The hub embeds the web UI in the binary, so you must build the website first. I use [Bun](https://bun.sh/), but you may use Node.js if you prefer:
|
||||
|
||||
@@ -288,7 +306,7 @@ Then in `beszel/cmd/hub`:
|
||||
CGO_ENABLED=0 go build -ldflags "-w -s" .
|
||||
```
|
||||
|
||||
### Cross-compiling
|
||||
#### Cross-compiling
|
||||
|
||||
You can cross-compile for different platforms using the `GOOS` and `GOARCH` environment variables.
|
||||
|
||||
@@ -298,7 +316,7 @@ For example, to build for FreeBSD ARM64:
|
||||
GOOS=freebsd GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-w -s" .
|
||||
```
|
||||
|
||||
You can see a list of valid options by running `go tool dist list`.
|
||||
See a list of valid options by running `go tool dist list`.
|
||||
|
||||
## License
|
||||
|
||||
|
Reference in New Issue
Block a user