Skip to content

Commit

Permalink
cli: include version
Browse files Browse the repository at this point in the history
  • Loading branch information
grampelberg committed Aug 23, 2024
1 parent d9457eb commit 42c39df
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ jobs:
tool: just,git-cliff,ripgrep

- name: build
run: just replace-version build-binary
run: |
just --evaluate version
just set-version
cargo pkgid
just build-binary
- name: rename
run: |-
Expand Down Expand Up @@ -91,7 +95,7 @@ jobs:
with:
tool: just,git-cliff,ripgrep
- name: set version
run: just replace-version
run: just set-version

- name: meta
id: meta
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ jobs:
body_path: CHANGELOG.md
name: unstable
prerelease: true
tag_name: main
tag_name: unstable
files: |-
/tmp/binaries/*
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ rules:
across the entire cluster. This will be updated in the future but requires
namespaces to be available via UI elements.

## Releases

- See releases for the latest tagged release.
- The `unstable` tag is updated on every merge to main.

## TODO

- Groups are probably what most users are going to want to use to configure all
Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Releases

Push a new tag to main and the `release` workflow will take care of the rest.

Note: versions are automatically managed as part of the github workflows, see
`just set-version` for what's actually happening. If you need a version replaced
in a file, set it to `just --evaluate version_placeholder`.
4 changes: 4 additions & 0 deletions docker/kuberift.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ RUN just build-binary

FROM debian:bookworm-slim AS runtime
WORKDIR /app
RUN apt-get update && apt-get install -y \
libssl3 && \
apt-get clean

COPY --from=builder /app/target/release/kuberift /usr/local/bin
CMD ["/usr/local/bin/kuberift", "serve", "-vv"]
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ extract-from-digests:

for digest in /tmp/digests/*/*; do
sha="$(basename "${digest}")"
name="$(basename $(dirname "${digest}"))"
echo "Extracting ${name}@sha256:${sha}"
name="kuberift-$(basename $(dirname "${digest}") | cut -d- -f2-)"
echo "Extracting {{ image }}@sha256:${sha}"

container_id="$(docker create {{ image }}@sha256:${sha})"
docker cp "${container_id}:/usr/local/bin/kuberift" "/tmp/bins/${name}"
docker rm "${container_id}"
done

replace-version:
set-version:
rg -g '!justfile' "{{ version_placeholder }}" -l | xargs -I {} sed -i '' -e 's/{{ version_placeholder }}/{{ version }}/g' {}
1 change: 1 addition & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use tracing_subscriber::{filter::EnvFilter, prelude::*};
pub(crate) static LEVEL: OnceLock<LevelFilter> = OnceLock::new();

#[derive(Parser, Container)]
#[command(about, version)]
pub struct Root {
#[command(subcommand)]
command: RootCmd,
Expand Down

0 comments on commit 42c39df

Please sign in to comment.