mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-21 23:47:34 +00:00
Add readme and makefile entry about code generation
This commit is contained in:
parent
2f045b20fb
commit
b8c89cd63c
5
Makefile
5
Makefile
@ -1,7 +1,7 @@
|
||||
# Calculate version
|
||||
version = $(shell ./scripts/version-at-commit.sh)
|
||||
|
||||
build:
|
||||
build: generate
|
||||
go build -ldflags "-s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=$(version)" cmd/headscale/headscale.go
|
||||
|
||||
dev: lint test build
|
||||
@ -25,3 +25,6 @@ lint:
|
||||
compress: build
|
||||
upx --brute headscale
|
||||
|
||||
generate:
|
||||
rm -rf gen
|
||||
buf generate proto
|
||||
|
35
README.md
35
README.md
@ -60,6 +60,41 @@ Please have a look at the documentation under [`docs/`](docs/).
|
||||
1. We have nothing to do with Tailscale, or Tailscale Inc.
|
||||
2. The purpose of writing this was to learn how Tailscale works.
|
||||
|
||||
## Contributing
|
||||
|
||||
To contribute to Headscale you would need the lastest version of [Go](golang.org) and [Buf](https://buf.build)(Protobuf generator).
|
||||
|
||||
### Install development tools
|
||||
|
||||
- Go
|
||||
- Buf
|
||||
- Protobuf tools:
|
||||
|
||||
```shell
|
||||
go install \
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
|
||||
google.golang.org/protobuf/cmd/protoc-gen-go \
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc
|
||||
```
|
||||
|
||||
Building the project requires the generation of Go code from Protobuf (in `proto/`) and it can be (re-)generated with:
|
||||
|
||||
```shell
|
||||
make generate
|
||||
```
|
||||
|
||||
To run the tests:
|
||||
|
||||
```shell
|
||||
make test
|
||||
```
|
||||
|
||||
To build the program:
|
||||
|
||||
```shell
|
||||
make build
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user