-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(grpc): created makefile tasks for generate gRPC API
- Loading branch information
Showing
11 changed files
with
54 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,5 @@ assets | |
*.mp4 | ||
|
||
# Nix | ||
result | ||
result | ||
api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,49 @@ | ||
DEST_DIR = /opt/komputer | ||
ARCH = $(shell uname -m) | ||
OUTPUT_DIR=./build | ||
PROTOBUF_API_DEST=./api | ||
|
||
ifeq ($(ARCH), x86_64) | ||
GOARCH="amd64" | ||
else | ||
GOARCH="arm64" | ||
endif | ||
|
||
dev: | ||
.PHONY: test clean | ||
|
||
dev: proto | ||
CGO_ENABLED=1 GOOS=linux GOARCH=$(GOARCH) go build -tags dev -o $(OUTPUT_DIR)/komputer ./cmd/komputer/main.go | ||
|
||
prod: | ||
|
||
prod: proto | ||
CGO_ENABLED=1 GOOS=linux GOARCH=$(GOARCH) go build -o $(OUTPUT_DIR)/komputer ./cmd/komputer/main.go | ||
|
||
test: | ||
go test -race ./bot/... | ||
tui: proto | ||
go build -o $(OUTPUT_DIR)/tui ./tui/cmd/main.go | ||
|
||
protobuf: cleanProto | ||
mkdir -p $(PROTOBUF_API_DEST) | ||
protoc --go_out=. ./proto/* | ||
|
||
test: proto | ||
go test -race ./... | ||
|
||
install: prod test | ||
mkdir -p $(DEST_DIR) | ||
cp -r assets $(DEST_DIR) | ||
cp $(OUTPUT_DIR)/komputer $(DEST_DIR) | ||
mkdir -p $(PROTOBUF_API_DEST) | ||
cp -r assets $(PROTOBUF_API_DEST) | ||
cp $(OUTPUT_DIR)/komputer $(PROTOBUF_API_DEST) | ||
|
||
uninstall: | ||
ifneq ("$(wildcard $(DEST_DIR))", "") | ||
rm -r $(DEST_DIR) | ||
ifneq ("$(wildcard $(PROTOBUF_API_DEST))", "") | ||
rm -r $(PROTOBUF_API_DEST) | ||
endif | ||
|
||
clean: | ||
clean: cleanProto | ||
ifneq ("$(wildcard $(OUTPUT_DIR))", "") | ||
rm -r build | ||
rm -r $(OUTPUT_DIR) | ||
endif | ||
|
||
cleanProto: | ||
ifneq ("$(wildcard $(PROTOBUF_API_DEST))", "") | ||
rm -r $(PROTOBUF_API_DEST) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
syntax = "proto3"; | ||
|
||
option go_package = "./api"; | ||
package komputer; | ||
|
||
enum Features { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters