diff --git a/.drone.yml b/.drone.yml index 849c3ae..12ea248 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,6 +10,7 @@ steps: - name: build image: rancher/dapper:v0.5.0 environment: + CROSS: 'true' GITHUB_TOKEN: from_secret: github_token commands: diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 1d66c2e..d5bd6a2 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -1,4 +1,4 @@ -ARG GOLANG=rancher/hardened-build-base:v1.20.6b2 +ARG GOLANG=rancher/hardened-build-base:v1.20.7b2 FROM ${GOLANG} ARG DAPPER_HOST_ARCH diff --git a/README.md b/README.md index edb16f1..df32902 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,40 @@ helm delete my-k3k To create a new cluster you need to install and run the cli or create a cluster object, to install the cli: -```sh -wget https://github.com/rancher/k3k/releases/download/v0.0.0-alpha6/k3kcli +#### For linux and macOS + +1 - Donwload the binary, linux dowload url: +``` +wget https://github.com/rancher/k3k/releases/download/v0.0.0-alpha2/k3kcli +``` +macOS dowload url: +``` +wget https://github.com/rancher/k3k/releases/download/v0.0.0-alpha2/k3kcli +``` +Then copy to local bin +``` chmod +x k3kcli sudo cp k3kcli /usr/local/bin ``` +#### For Windows + +1 - Download the Binary: +Use PowerShell's Invoke-WebRequest cmdlet to download the binary: +```powershel +Invoke-WebRequest -Uri "https://github.com/rancher/k3k/releases/download/v0.0.0-alpha2/k3kcli-windows" -OutFile "k3kcli.exe" +``` +2 - Copy the Binary to a Directory in PATH: +To allow running the binary from any command prompt, you can copy it to a directory in your system's PATH. For example, copying it to C:\Users\\bin (create this directory if it doesn't exist): +``` +Copy-Item "k3kcli.exe" "C:\bin" +``` +3 - Update Environment Variable (PATH): +If you haven't already added `C:\bin` (or your chosen directory) to your PATH, you can do it through PowerShell: +``` +setx PATH "C:\bin;%PATH%" +``` + To create a new cluster you can use: ```sh diff --git a/manifest-runtime.tmpl b/manifest-runtime.tmpl index 05a21a6..40928fb 100644 --- a/manifest-runtime.tmpl +++ b/manifest-runtime.tmpl @@ -3,4 +3,16 @@ manifests: - image: rancher/k3k:{{replace "+" "-" build.tag}}-amd64 platform: architecture: amd64 + os: linux + - image: rancher/k3k:{{replace "+" "-" build.tag}}-arm64 + platform: + architecture: arm64 + os: linux + - image: rancher/k3k:{{replace "+" "-" build.tag}}-windows-amd64 + platform: + architecture: amd64 + os: windows + - image: rancher/k3k:{{replace "+" "-" build.tag}}-s390x + platform: + architecture: s390x os: linux \ No newline at end of file diff --git a/ops/build b/ops/build index e912c51..433d784 100755 --- a/ops/build +++ b/ops/build @@ -15,14 +15,21 @@ LINKFLAGS="-X github.com/rancher/k3k.Version=$VERSION" LINKFLAGS="-X github.com/rancher/k3k.GitCommit=$COMMIT $LINKFLAGS" CGO_ENABLED=0 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/k3k if [ "$CROSS" = "true" ] && [ "$ARCH" = "amd64" ]; then - GOOS=darwin go build -ldflags "$LINKFLAGS" -o bin/k3k-darwin - GOOS=windows go build -ldflags "$LINKFLAGS" -o bin/k3k-windows + CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/k3k-s390x + CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/k3k-arm64 + GOOS=freebsd GOARCH=arm64 go build -ldflags "$LINKFLAGS" -o bin/k3k-freebsd + GOOS=darwin GOARCH=amd64 go build -ldflags "$LINKFLAGS" -o bin/k3k-darwin-amd64 + GOOS=darwin GOARCH=arm64 go build -ldflags "$LINKFLAGS" -o bin/k3k-darwin + GOOS=windows GOARCH=amd64 go build -ldflags "$LINKFLAGS" -o bin/k3k-windows fi # build k3kcli CGO_ENABLED=0 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/k3kcli ./cli if [ "$CROSS" = "true" ] && [ "$ARCH" = "amd64" ]; then - GOOS=darwin go build -ldflags "$LINKFLAGS" -o bin/k3kcli-darwin ./cli - GOOS=windows go build -ldflags "$LINKFLAGS" -o bin/k3kcli-windows ./cli + CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/k3kcli-s390x ./cli + CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/k3kcli-arm64 ./cli + GOOS=freebsd GOARCH=arm64 go build -ldflags "$LINKFLAGS" -o bin/k3k-freebsd ./cli + GOOS=darwin GOARCH=amd64 go build -ldflags "$LINKFLAGS" -o bin/k3kcli-darwin-adm64 ./cli + GOOS=darwin GOARCH=arm64 go build -ldflags "$LINKFLAGS" -o bin/k3kcli-darwin ./cli + GOOS=windows GOARCH=amd64 go build -ldflags "$LINKFLAGS" -o bin/k3kcli-windows ./cli fi -