diff --git a/documentation/content/en/installation/kpt-cli.md b/documentation/content/en/installation/kpt-cli.md index 15445e9fe5..076dff055d 100644 --- a/documentation/content/en/installation/kpt-cli.md +++ b/documentation/content/en/installation/kpt-cli.md @@ -6,28 +6,104 @@ Users can get kpt CLI in a variety of ways: Download pre-compiled binaries: -- [Linux (amd64)][linux-amd64] -- [Linux (arm64)][linux-arm64] -- [MacOS (amd64)][darwin-amd64] -- [MacOS (arm64)][darwin-arm64] +{{< tabpane text=true >}} +{{% tab header="Linux amd64" %}} +```shell +curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/kpt_linux_amd64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{% tab header="Linux arm64" %}} +```shell +curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/kpt_linux_arm64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{% tab header="macOS amd64" %}} +```shell +curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/kpt_darwin_amd64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{% tab header="macOS arm64" %}} +```shell +curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/kpt_darwin_arm64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{< /tabpane >}} Optionally verify the [SLSA3 signatures](https://slsa.dev/) generated using the OpenSSF's [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator) during the release -process. To verify a release binary: +process. To verify a release archive: 1. Install the verification tool from [slsa-framework/slsa-verifier#installation](https://github.com/slsa-framework/slsa-verifier#installation). -2. Download the signature file `multiple.intoto.jsonl` from the [GitHub releases page](https://github.com/kptdev/kpt/releases). +2. Download the signature file: + +```shell +curl -LO https://github.com/kptdev/kpt/releases/download/v{{< kpt_version >}}/multiple.intoto.jsonl +``` 3. Run the verifier: +{{< tabpane text=true >}} +{{% tab header="Linux amd64" %}} +```shell +slsa-verifier verify-artifact \ + --provenance-path multiple.intoto.jsonl \ + --source-uri github.com/kptdev/kpt \ + --source-versioned-tag v{{< kpt_version >}} \ + kpt_linux_amd64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{% tab header="Linux arm64" %}} +```shell +slsa-verifier verify-artifact \ + --provenance-path multiple.intoto.jsonl \ + --source-uri github.com/kptdev/kpt \ + --source-versioned-tag v{{< kpt_version >}} \ + kpt_linux_arm64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{% tab header="macOS amd64" %}} ```shell -slsa-verifier verify-artifact --provenance-path multiple.intoto.jsonl --source-uri github.com/kptdev/kpt --source-versioned-tag kpt__ +slsa-verifier verify-artifact \ + --provenance-path multiple.intoto.jsonl \ + --source-uri github.com/kptdev/kpt \ + --source-versioned-tag v{{< kpt_version >}} \ + kpt_darwin_amd64-{{< kpt_version >}}.tar.gz ``` +{{% /tab %}} +{{% tab header="macOS arm64" %}} +```shell +slsa-verifier verify-artifact \ + --provenance-path multiple.intoto.jsonl \ + --source-uri github.com/kptdev/kpt \ + --source-versioned-tag v{{< kpt_version >}} \ + kpt_darwin_arm64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{< /tabpane >}} -On Linux and MacOS, make it executable: +After downloading (and optionally verifying), extract the archive: +{{< tabpane text=true >}} +{{% tab header="Linux amd64" %}} +```shell +tar -xzf kpt_linux_amd64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{% tab header="Linux arm64" %}} +```shell +tar -xzf kpt_linux_arm64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{% tab header="macOS amd64" %}} ```shell -chmod +x kpt +tar -xzf kpt_darwin_amd64-{{< kpt_version >}}.tar.gz ``` +{{% /tab %}} +{{% tab header="macOS arm64" %}} +```shell +tar -xzf kpt_darwin_arm64-{{< kpt_version >}}.tar.gz +``` +{{% /tab %}} +{{< /tabpane >}} On MacOS the first time, it may be necessary to open the program from the finder with _ctrl-click open_. @@ -89,20 +165,20 @@ Running kpt via Docker does not install kpt on your machine. Each `docker run .. ### `kpt` ```shell -docker run ghcr.io/kptdev/kpt:{{< kpt_version >}} version +docker run ghcr.io/kptdev/kpt:v{{< kpt_version >}} version ``` To use kpt with files on your host, mount your current directory into the container and set a working directory: ```shell -docker run --rm -v "$PWD":/workdir -w /workdir ghcr.io/kptdev/kpt:{{< kpt_version >}} pkg tree -docker run --rm -v "$PWD":/workdir -w /workdir ghcr.io/kptdev/kpt:{{< kpt_version >}} fn render +docker run --rm -v "$PWD":/workdir -w /workdir ghcr.io/kptdev/kpt:v{{< kpt_version >}} pkg tree +docker run --rm -v "$PWD":/workdir -w /workdir ghcr.io/kptdev/kpt:v{{< kpt_version >}} fn render ``` On Windows PowerShell, use `${PWD}.Path` for the current directory: ```shell -docker run --rm -v "${PWD}.Path:/workdir" -w /workdir ghcr.io/kptdev/kpt:{{< kpt_version >}} pkg tree +docker run --rm -v "${PWD}.Path:/workdir" -w /workdir ghcr.io/kptdev/kpt:v{{< kpt_version >}} pkg tree ``` This pattern ensures kpt reads and writes files under `/workdir`, which maps to your current directory on the host. @@ -166,13 +242,4 @@ kpt version [ghcr.io/kptdev/kpt]: https://github.com/kptdev/kpt/pkgs/container/kpt [cloud-sdk]: https://github.com/GoogleCloudPlatform/cloud-sdk-docker - -[linux-amd64]: -https://github.com/kptdev/kpt/releases/download/{{< kpt_version >}}/kpt_linux_amd64 -[linux-arm64]: -https://github.com/kptdev/kpt/releases/download/{{< kpt_version >}}/kpt_linux_arm64 -[darwin-amd64]: -https://github.com/kptdev/kpt/releases/download/{{< kpt_version >}}/kpt_darwin_amd64 -[darwin-arm64]: -https://github.com/kptdev/kpt/releases/download/{{< kpt_version >}}/kpt_darwin_arm64 [bash-completion]: https://github.com/scop/bash-completion#installation diff --git a/documentation/layouts/shortcodes/kpt_version.html b/documentation/layouts/shortcodes/kpt_version.html index 2b652ff4c3..5f4b51cc9d 100644 --- a/documentation/layouts/shortcodes/kpt_version.html +++ b/documentation/layouts/shortcodes/kpt_version.html @@ -1 +1 @@ -{{- getenv "HUGO_KPT_VERSION" | default .Site.Params.kpt_version -}} \ No newline at end of file +{{- (getenv "HUGO_KPT_VERSION" | default .Site.Params.kpt_version) | strings.TrimPrefix "v" -}}