Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/release-body.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ steps:
# Homebrew (macOS & Linux)
brew install bmscomp/tap/kates

# Debian / Ubuntu
curl -fsSLO https://github.com/bmscomp/kates/releases/download/__TAG__/kates-linux-$(dpkg --print-architecture).deb
sudo apt install ./kates-linux-$(dpkg --print-architecture).deb

# Fedora / RHEL
sudo dnf install https://github.com/bmscomp/kates/releases/download/__TAG__/kates-linux-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').rpm

# Alpine (the package is unsigned)
curl -fsSLO https://github.com/bmscomp/kates/releases/download/__TAG__/kates-linux-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').apk
apk add --allow-untrusted ./kates-linux-*.apk

# Direct binary archive (__TAG__)
curl -fsSL https://github.com/bmscomp/kates/releases/download/__TAG__/kates-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz | tar -xz
```
Expand Down
35 changes: 32 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,39 @@ jobs:
with:
subject-path: cli/kates-${{ matrix.os }}-${{ matrix.arch }}.tar.gz

# The same binary as a .deb, .rpm and .apk (cli/nfpm.yaml), named like
# the tarball so /releases/latest/download/kates-linux-amd64.deb always
# resolves; nfpm's own names put a ~ in pre-release versions.
- name: Package deb, rpm and apk
if: matrix.os == 'linux'
working-directory: cli
env:
NFPM_VERSION: v2.48.0
run: |
GOBIN="${RUNNER_TEMP}/bin" go install "github.com/goreleaser/nfpm/v2/cmd/nfpm@${NFPM_VERSION}"
for packager in deb rpm apk; do
PACKAGE="kates-linux-${{ matrix.arch }}.${packager}"
ARCH="${{ matrix.arch }}" VERSION="${GITHUB_REF_NAME#v}" \
"${RUNNER_TEMP}/bin/nfpm" package --config nfpm.yaml --packager "${packager}" --target "${PACKAGE}"
shasum -a 256 "${PACKAGE}" > "${PACKAGE}.sha256"
done

- name: Attest package provenance
if: matrix.os == 'linux'
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: |
cli/kates-linux-${{ matrix.arch }}.deb
cli/kates-linux-${{ matrix.arch }}.rpm
cli/kates-linux-${{ matrix.arch }}.apk

- name: Upload artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: kates-${{ matrix.os }}-${{ matrix.arch }}
path: |
cli/kates-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
cli/kates-${{ matrix.os }}-${{ matrix.arch }}.tar.gz.sha256
# The tarball, on linux the packages, and each one's .sha256.
path: cli/kates-${{ matrix.os }}-${{ matrix.arch }}.*
if-no-files-found: error

editor-extensions:
name: Package Editor Extensions
Expand Down Expand Up @@ -277,6 +303,9 @@ jobs:
generate_release_notes: true
files: |
dist/kates-*.tar.gz
dist/kates-linux-*.deb
dist/kates-linux-*.rpm
dist/kates-linux-*.apk
dist/vscode-kates-*.vsix
dist/visualstudio-kates-*.zip
dist/checksums.txt
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Without Homebrew on Linux, install Docker Engine, Kind, kubectl and Helm from th
curl -fsSL https://raw.githubusercontent.com/bmscomp/kates/main/scripts/install-kates.sh | bash
```

Or download `kates-<os>-<arch>.tar.gz` from the [latest release](https://github.com/bmscomp/kates/releases/latest): it holds a single `kates` binary. Install [cosign](https://docs.sigstore.dev/cosign/system_config/installation/) too, so `kates deploy` can check the signatures of the charts it pulls.
Or download `kates-<os>-<arch>.tar.gz` from the [latest release](https://github.com/bmscomp/kates/releases/latest): it holds a single `kates` binary. On Debian, Ubuntu, Fedora or Alpine, the same release has `kates-linux-<arch>.deb`, `.rpm` and `.apk` packages (`sudo apt install ./kates-linux-amd64.deb`); see [Installation](docs/book/10-cli-reference.md#installation). Install [cosign](https://docs.sigstore.dev/cosign/system_config/installation/) too, so `kates deploy` can check the signatures of the charts it pulls.

Run a CI quality gate against a minimum grade:

Expand Down
25 changes: 25 additions & 0 deletions cli/nfpm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# The .deb, .rpm and .apk of the release binary. release.yml runs
# `nfpm package` with this file once per packager for each linux build, in
# cli/ where the tarball step leaves kates and LICENSE.
name: kates
arch: ${ARCH}
platform: linux
version: ${VERSION}
version_schema: semver
section: utils
priority: optional
maintainer: bmscomp <bmscomp@gmail.com>
description: |
Benchmark, fault-test and audit Apache Kafka clusters on Kubernetes.
Kates deploys Strimzi Kafka, runs benchmark workloads and fault
injections, and grades the results against A-F SLA gates.
vendor: bmscomp
homepage: https://github.com/bmscomp/kates
license: Apache-2.0
contents:
- src: ./kates
dst: /usr/bin/kates
file_info:
mode: 0755
- src: ./LICENSE
dst: /usr/share/doc/kates/LICENSE
13 changes: 12 additions & 1 deletion docs/book/10-cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Example IDs, such as `3f8a2c1e`, have the eight hexadecimal characters the Kates

## Installation

The CLI is one binary, released for macOS and Linux on amd64 and arm64. Install a release in one of three ways:
The CLI is one binary, released for macOS and Linux on amd64 and arm64. Install a release in one of four ways:

- With Homebrew, on macOS or Linux: `brew install bmscomp/tap/kates`, which also installs cosign. `brew upgrade bmscomp/tap/kates` moves to a newer release.
- With the release installer, which downloads the archive for your platform, checks it against the release's `checksums.txt` and puts `kates` in `/usr/local/bin` (`INSTALL_DIR` changes it):
Expand All @@ -33,6 +33,17 @@ The CLI is one binary, released for macOS and Linux on amd64 and arm64. Install
```

- From the [GitHub Release](https://github.com/bmscomp/kates/releases/latest), by downloading `kates-<os>-<arch>.tar.gz` and putting the `kates` it holds on your `PATH`.
- On Linux, as a package from the same release: `kates-linux-<arch>.deb`, `.rpm` or `.apk`, which puts `kates` in `/usr/bin` and lets the package manager remove it. The packages come from no apt or dnf repository, so `apt upgrade` does not see a new release: install it the same way.

```bash
latest=https://github.com/bmscomp/kates/releases/latest/download
# Debian, Ubuntu
curl -fsSLO "${latest}/kates-linux-$(dpkg --print-architecture).deb"
sudo apt install ./kates-linux-*.deb
# Fedora, RHEL
sudo dnf install \
"${latest}/kates-linux-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').rpm"
```

Without Homebrew, install [cosign](https://docs.sigstore.dev/cosign/system_config/installation/) as well, so `kates deploy` can check the charts it pulls. To deploy the lab, the CLI also needs Docker, Kind, kubectl and Helm: [Prerequisites](12-deployment.md#prerequisites) in the Deployment Guide lists them.

Expand Down
Loading