mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
chore: move proto generation to mise tasks
This commit is contained in:
@@ -69,7 +69,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate Protobuf files
|
- name: Generate Protobuf files
|
||||||
run: |
|
run: |
|
||||||
make proto
|
mise run proto
|
||||||
# check if the generated files are up to date
|
# Check if the generated files are up to date.
|
||||||
git diff --exit-code ||
|
git diff --exit-code ||
|
||||||
(echo "Generated protobuf files are not up to date. Please run 'make proto' and commit the changes." && exit 1)
|
(echo "Generated protobuf files are not up to date. Please run 'mise run proto' and commit the changes." && exit 1)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# TODO: Makefile is deprecated, add new targets as mise tasks in mise.toml instead.
|
||||||
|
|
||||||
CORROSION_IMAGE ?= ghcr.io/psviderski/corrosion:latest
|
CORROSION_IMAGE ?= ghcr.io/psviderski/corrosion:latest
|
||||||
UCIND_IMAGE ?= ghcr.io/psviderski/ucind:latest
|
UCIND_IMAGE ?= ghcr.io/psviderski/ucind:latest
|
||||||
|
|
||||||
@@ -42,13 +44,7 @@ ucind-cluster:
|
|||||||
|
|
||||||
.PHONY: proto
|
.PHONY: proto
|
||||||
proto:
|
proto:
|
||||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
mise run proto
|
||||||
--proto_path=. --proto_path=internal/machine/api/vendor internal/machine/api/pb/*.proto
|
|
||||||
|
|
||||||
.PHONY: proto-mise
|
|
||||||
proto-mise:
|
|
||||||
mise exec -- protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
|
||||||
--proto_path=. --proto_path=internal/machine/api/vendor internal/machine/api/pb/*.proto
|
|
||||||
|
|
||||||
.PHONY: corrosion-image
|
.PHONY: corrosion-image
|
||||||
corrosion-image:
|
corrosion-image:
|
||||||
@@ -84,12 +80,12 @@ test-e2e:
|
|||||||
|
|
||||||
.PHONY: test-clean
|
.PHONY: test-clean
|
||||||
test-clean:
|
test-clean:
|
||||||
@CONTAINERS=$$(docker ps --filter "name=ucind-test" -q); \
|
@CONTAINERS=$$(docker ps --filter "label=ucind.managed" -q); \
|
||||||
if [ -n "$$CONTAINERS" ]; then \
|
if [ -n "$$CONTAINERS" ]; then \
|
||||||
echo "Killing containers..."; \
|
echo "Killing containers..."; \
|
||||||
docker kill $$CONTAINERS; \
|
docker kill $$CONTAINERS; \
|
||||||
fi; \
|
fi; \
|
||||||
CONTAINERS_STOPPED=$$(docker ps -a --filter "name=ucind-test" -q); \
|
CONTAINERS_STOPPED=$$(docker ps -a --filter "label=ucind.managed" -q); \
|
||||||
if [ -n "$$CONTAINERS_STOPPED" ]; then \
|
if [ -n "$$CONTAINERS_STOPPED" ]; then \
|
||||||
echo "Removing stopped containers..."; \
|
echo "Removing stopped containers..."; \
|
||||||
docker rm $$CONTAINERS_STOPPED; \
|
docker rm $$CONTAINERS_STOPPED; \
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ protoc-gen-go-grpc = "1.5.1"
|
|||||||
[env]
|
[env]
|
||||||
_.file = ".env"
|
_.file = ".env"
|
||||||
|
|
||||||
|
[tasks.proto]
|
||||||
|
description = "Regenerate gRPC API code from .proto files"
|
||||||
|
run = """
|
||||||
|
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
||||||
|
--proto_path=. --proto_path=internal/machine/api/vendor internal/machine/api/pb/*.proto
|
||||||
|
"""
|
||||||
|
|
||||||
[tasks.mise-lock]
|
[tasks.mise-lock]
|
||||||
description = "Update mise.lock with hashes for all platforms"
|
description = "Update mise.lock with hashes for all platforms"
|
||||||
run = "mise lock --platform linux-x64,macos-arm64"
|
run = "mise lock --platform linux-x64,macos-arm64"
|
||||||
|
|||||||
Reference in New Issue
Block a user