2024-10-18 20:58:15 -05:00
|
|
|
all:
|
|
|
|
# You must use the current protoc-gen-go
|
|
|
|
# protoc --version 3.6++ does not mean that protoc will generate version3 .go files
|
|
|
|
#
|
|
|
|
# apt remove golang-goprotobuf-dev
|
|
|
|
# apt install protobuf-compiler
|
|
|
|
#
|
|
|
|
# Then:
|
|
|
|
# go get -u github.com/golang/protobuf/protoc-gen-go
|
|
|
|
# cd ~/go/src/github.com/golang/protobuf/protoc-gen-go
|
|
|
|
# go install
|
|
|
|
#
|
|
|
|
# Then:
|
|
|
|
protoc --version
|
|
|
|
make droplet.pb.go
|
2024-10-22 03:26:02 -05:00
|
|
|
make hypervisor.pb.go
|
|
|
|
make cluster.pb.go
|
2024-10-22 06:19:24 -05:00
|
|
|
make -C configfile
|
2024-10-21 17:53:36 -05:00
|
|
|
|
2024-10-22 14:40:59 -05:00
|
|
|
vet: lint
|
2024-10-21 17:53:36 -05:00
|
|
|
GO111MODULE=off go vet
|
|
|
|
|
|
|
|
lint:
|
|
|
|
buf lint droplet.proto
|
|
|
|
|
|
|
|
# autofixes your import headers in your golang files
|
|
|
|
goimports:
|
|
|
|
goimports -w *.go
|
2024-10-22 06:19:24 -05:00
|
|
|
make -C configfile goimports
|
2024-10-18 20:58:15 -05:00
|
|
|
|
|
|
|
redomod:
|
|
|
|
rm -f go.*
|
|
|
|
GO111MODULE= go mod init
|
|
|
|
GO111MODULE= go mod tidy
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.pb.go
|
2024-10-21 19:24:16 -05:00
|
|
|
-rm -f go.*
|
2024-10-22 06:19:24 -05:00
|
|
|
make -C configfile clean
|
2024-10-18 20:58:15 -05:00
|
|
|
|
|
|
|
droplet.pb.go: droplet.proto
|
2024-10-21 18:28:59 -05:00
|
|
|
# protoc --go_out=. droplet.proto
|
|
|
|
# This is switched over to use the new protoc-gen-go from google.golang.org/protobuf/cmd/protoc-gen-go
|
|
|
|
# the debian one (2024/10/21) seems to be the older/original one from github.com/golang/protobuf/protoc-gen-go
|
|
|
|
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
--go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
droplet.proto
|
|
|
|
|
2024-10-22 03:26:02 -05:00
|
|
|
hypervisor.pb.go: hypervisor.proto
|
|
|
|
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
--go_opt=Mhypervisor.proto=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
hypervisor.proto
|
|
|
|
|
2024-10-22 02:51:45 -05:00
|
|
|
cluster.pb.go: cluster.proto
|
|
|
|
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
--go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \
|
|
|
|
--go_opt=Mcluster.proto=go.wit.com/lib/protobuf/virtbuf \
|
2024-10-22 03:26:02 -05:00
|
|
|
--go_opt=Mhypervisor.proto=go.wit.com/lib/protobuf/virtbuf \
|
2024-10-22 02:51:45 -05:00
|
|
|
cluster.proto
|
|
|
|
|
2024-10-18 20:58:15 -05:00
|
|
|
|
|
|
|
events.pb.go: events.proto
|
|
|
|
protoc --go_out=. events.proto
|
|
|
|
|
|
|
|
account.pb.go: account.proto
|
|
|
|
protoc --go_out=. account.proto
|
|
|
|
|
|
|
|
config.pb.go: config.proto
|
|
|
|
protoc --go_out=. config.proto
|
|
|
|
|
|
|
|
compile:
|
|
|
|
protoc --go_out=. *.proto
|
|
|
|
|
|
|
|
deps:
|
|
|
|
apt install golang-goprotobuf-dev
|
|
|
|
apt install protobuf-compiler
|
|
|
|
|
|
|
|
push:
|
|
|
|
git pull
|
|
|
|
git add --all
|
|
|
|
git commit -a -s
|
|
|
|
git push
|