Compiles .proto definition files into Go code.
- Download: https://github.com/protocolbuffers/protobuf/releases
- Add to
PATHafter installation
protoc --version
# libprotoc 34.0# Go protobuf code generation
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
# Go gRPC code generation
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
# gRPC Gateway (REST → gRPC reverse proxy) code generation
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latestRequired for gRPC Gateway HTTP annotations. Located in api/proto/google/api/.
mkdir -p api/proto/google/api
curl -sL https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/annotations.proto \
-o api/proto/google/api/annotations.proto
curl -sL https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/http.proto \
-o api/proto/google/api/http.proto# Build client binary
make build
# Build for all platforms
make build-all
# Build server & client containers
docker build -f delivery/container/server.Dockerfile -t delivery-server .
docker build -f delivery/container/client.Dockerfile -t delivery-client .make protoThis runs:
protoc -I api/proto \
--go_out=api/gen/ --go-grpc_out=api/gen/ --grpc-gateway_out=api/gen/ \
--go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --grpc-gateway_opt=paths=source_relative \
api/proto/deploy.protoGenerated files:
api/gen/deploy.pb.go— protobuf message definitionsapi/gen/deploy_grpc.pb.go— gRPC server/client stubsapi/gen/deploy.pb.gw.go— REST gateway reverse proxy
| Package | Purpose |
|---|---|
google.golang.org/grpc |
gRPC framework |
google.golang.org/protobuf |
Protocol Buffers runtime |
github.com/grpc-ecosystem/grpc-gateway/v2 |
REST API gateway |
github.com/go-git/go-git/v5 |
Git operations (clone, fetch, commit, push) |
github.com/fatih/color |
Terminal color output |
github.com/joho/godotenv |
.env file loader |
github.com/sirupsen/logrus |
Logging |
gopkg.in/yaml.v3 |
YAML parsing |
| Tool | Environment Variable | Default Path | Purpose |
|---|---|---|---|
| kustomize | DELIVERY_KUSTOMIZE_PATH |
/usr/bin/kustomize |
Update kustomization.yaml image tags |
| yq | DELIVERY_YQ_PATH |
/usr/bin/yq |
Update YAML values |
| yamlfmt | DELIVERY_YAMLFMT_PATH |
/usr/bin/yamlfmt |
YAML formatting |
# Start server
make start
# Run client
make client