diff --git a/.gitignore b/.gitignore index 04f67e1..40615ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ cli/kdo/bin/ -cli/kdo/__debug_bin \ No newline at end of file +cli/kdo/rel/ +cli/kdo/__debug_bin diff --git a/cli/kdo/buildrel.sh b/cli/kdo/buildrel.sh new file mode 100755 index 0000000..3c9705e --- /dev/null +++ b/cli/kdo/buildrel.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +VERSION=$1 +if [ -z "$VERSION" ]; then + echo >&2 Error: missing version + exit 1 +fi + +mkdir -p rel + +echo Building Darwin binary... +GOOS=darwin GOARCH=amd64 go build -o bin/darwin/amd64/kdo -v +echo Packaging Darwin binary... +cd bin/darwin/amd64 +sudo chown 0:0 kdo +tar -czvf ../../../rel/kdo-v$VERSION-darwin-amd64.tar.gz kdo +cd ../../.. + +echo Building Linux binary... +GOOS=linux GOARCH=amd64 go build -o bin/linux/amd64/kdo -v +echo Packaging Linux binary... +cd bin/linux/amd64 +sudo chown 0:0 kdo +tar -czvf ../../../rel/kdo-v$VERSION-linux-amd64.tar.gz kdo +cd ../../.. + +echo Building Windows binary... +GOOS=windows GOARCH=amd64 go build -o bin/windows/amd64/kdo.exe -v +echo Packaging Windows binary... +cd bin/windows/amd64 +sudo chown 0:0 kdo.exe +zip ../../../rel/kdo-v$VERSION-windows-amd64.zip kdo.exe +cd ../../.. \ No newline at end of file diff --git a/cli/kdo/kdo.go b/cli/kdo/kdo.go index e6e8172..36dc757 100644 --- a/cli/kdo/kdo.go +++ b/cli/kdo/kdo.go @@ -23,7 +23,7 @@ import ( var cmd = &cobra.Command{ Short: "kdo is sudo for Kubernetes", Use: usage, - Version: "0.3.0", + Version: "0.4.0", Example: examples, RunE: run, }