From a001935f6f155381723235e023779e3d2a4cd0b8 Mon Sep 17 00:00:00 2001 From: howieyuen Date: Thu, 15 Dec 2022 11:24:49 +0800 Subject: [PATCH] refactor: rename kusionctl to kusion (#196) --- Makefile | 15 +++++---------- doc.go | 2 +- hack/run-e2e.sh | 2 +- cmd/kusionctl/kusionctl.go => kusion.go | 1 + 4 files changed, 8 insertions(+), 12 deletions(-) rename cmd/kusionctl/kusionctl.go => kusion.go (99%) diff --git a/Makefile b/Makefile index c8d235b5..e15636a7 100644 --- a/Makefile +++ b/Makefile @@ -77,8 +77,7 @@ build-local-kusion-darwin: ## Build kusionctl only for macOS # Build kusion GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 \ go build -o ./_build/bundles/kusion-darwin/bin/kusion \ - -ldflags="-s -w" \ - ./cmd/kusionctl + -ldflags="-s -w" . build-local-darwin: ## Build kusion tool chain for macOS # Delete old artifacts @@ -92,8 +91,7 @@ build-local-darwin: ## Build kusion tool chain for macOS # Build kusion GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 \ go build -o ./_build/bundles/kusion-darwin/bin/kusion \ - -ldflags="-s -w" \ - ./cmd/kusionctl + -ldflags="-s -w" . build-local-darwin-all: build-local-darwin ## Build kusion & kcl tool chain for macOS # Install kclvm darwin @@ -148,8 +146,7 @@ build-local-darwin-arm64: ## Build kusion tool chain for macOS arm64 # Build kusion GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 \ go build -o ./_build/bundles/kusion-darwin-arm64/bin/kusion \ - -ldflags="-s -w" \ - ./cmd/kusionctl + -ldflags="-s -w" . build-local-darwin-arm64-all: build-local-darwin-arm64 ## Build kusion & kcl tool chain for macOS arm64 # Install kclvm darwin @@ -209,8 +206,7 @@ build-local-linux: ## Build kusion tool chain for linux # Build kusion GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \ go build -o ./_build/bundles/kusion-linux/bin/kusion \ - -ldflags="-s -w" \ - ./cmd/kusionctl + -ldflags="-s -w" . build-local-linux-all: @echo -e "$(CCRED)**** The use of build-local-linux-alle is deprecated. Use build-local-ubuntu-all or build-local-centos-all instead. ****$(CCEND)" @@ -317,8 +313,7 @@ build-local-windows: ## Build kusion tool chain for windows # Build kusion GOOS=windows GOARCH=amd64 CGO_ENABLED=0 \ go build -o ./_build/bundles/kusion-windows/bin/kusion.exe \ - -ldflags="-s -w" \ - ./cmd/kusionctl + -ldflags="-s -w" . build-local-windows-all: build-local-windows ## Build kusion & kcl tool chain for windows # Install kclvm windows diff --git a/doc.go b/doc.go index 4a0adf2a..b161761d 100644 --- a/doc.go +++ b/doc.go @@ -1,3 +1,3 @@ // kusion is a cloud-native engineering system, // which manages the infrastructure by code. -package kusion +package main diff --git a/hack/run-e2e.sh b/hack/run-e2e.sh index 2755de43..0d243ad3 100755 --- a/hack/run-e2e.sh +++ b/hack/run-e2e.sh @@ -11,7 +11,7 @@ set -o pipefail GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo@v2.0.0 # Build kusion binary -go build -o bin/kusion ./cmd/kusionctl/kusionctl.go +go build -o bin/kusion . # Run e2e diff --git a/cmd/kusionctl/kusionctl.go b/kusion.go similarity index 99% rename from cmd/kusionctl/kusionctl.go rename to kusion.go index 06117b42..099ec7a5 100644 --- a/cmd/kusionctl/kusionctl.go +++ b/kusion.go @@ -6,6 +6,7 @@ import ( "time" _ "kusionstack.io/kcl-plugin" + "kusionstack.io/kusion/pkg/kusionctl/cmd" "kusionstack.io/kusion/pkg/util/pretty" )