Files
uncloud/mise.toml
T

101 lines
2.8 KiB
TOML

[settings]
experimental = true
lockfile = true
[tools]
"aqua:vektra/mockery" = "3.8.1"
go = "1.26.1"
golangci-lint = "2.11.2"
goreleaser = "2.15.2"
node = "22.20.0"
protoc = "27.3"
protoc-gen-go = "1.34.2"
protoc-gen-go-grpc = "1.5.1"
[vars]
corrosion_version = "2026.6.15"
ucind_image = "ghcr.io/psviderski/ucind:latest"
[env]
_.file = ".env"
[tasks."build:uncloudd-amd64"]
description = "Build uncloudd for linux/amd64"
run = """
VERSION=$(git describe --tags --always --dirty) \
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/psviderski/uncloud/internal/version.version=$VERSION" \
-o uncloudd-linux-amd64 ./cmd/uncloudd
"""
outputs = ["uncloudd-linux-amd64"]
[tasks."build:uncloudd-arm64"]
description = "Build uncloudd for linux/arm64"
run = """
VERSION=$(git describe --tags --always --dirty) \
GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/psviderski/uncloud/internal/version.version=$VERSION" \
-o uncloudd-linux-arm64 ./cmd/uncloudd
"""
outputs = ["uncloudd-linux-arm64"]
[tasks."docs:cli"]
description = "Regenerate the CLI reference docs"
run = "go run ./cmd/uc docs"
[tasks."docs:dev"]
description = "Run the documentation website locally"
dir = "website"
run = "npm start --"
[tasks.fmt]
description = "Format Go code and imports"
alias = "format"
env.GOOS = "linux"
run = "golangci-lint fmt"
[tasks.lint]
description = "Check Go code and formatting"
# Explicitly set OS to Linux to not skip *_linux.go files when running on macOS.
# Uncloud daemon won't likely support OS other than Linux anytime soon, so for now we can rely on that.
env.GOOS = "linux"
run = "golangci-lint run"
[tasks."lint:fix"]
description = "Format Go code and apply available lint fixes"
alias = "lint-and-fix"
env.GOOS = "linux"
run = "golangci-lint run --fix"
[tasks.mocks]
description = "Regenerate Go test mocks"
run = "mockery"
[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=api/pb/vendor api/pb/*.proto pkg/distlock/grpc/*.proto
"""
[tasks.uc]
description = "Run the Uncloud CLI"
raw_args = true
run = "go run ./cmd/uc"
[tasks.ucind]
description = "Run ucind CLI for managing local Docker-based clusters"
raw_args = true
run = "go run ./cmd/ucind"
[tasks."ucind:image"]
description = "Build the ucind Docker image"
run = "docker build --build-arg CORROSION_VERSION={{vars.corrosion_version}} -t {{vars.ucind_image}} --target ucind ."
[tasks."ucind:cleanup"]
description = "Remove ucind managed containers and networks"
run = """
echo "==> Removing ucind managed containers..."
docker ps --filter "label=ucind.managed" -q | xargs docker rm -f
echo "==> Removing ucind managed networks..."
docker network ls --filter "label=ucind.managed" -q | xargs docker network rm -f
"""