Skip to content

Commit

Permalink
Fix hash version and add version command (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgb authored Jan 25, 2024
1 parent 2985665 commit 71d9765
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN touch /work/plane/plane-dynamic/src/lib.rs
RUN cargo build -p plane --release --locked

COPY .cargo .cargo
COPY .git .git
COPY plane plane
RUN cargo build -p plane --release --locked

Expand Down
1 change: 1 addition & 0 deletions docker/quickstart/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN touch /work/plane/plane-dynamic/src/lib.rs
RUN cargo build -p plane --release --locked

COPY .cargo .cargo
COPY .git .git
COPY plane plane
RUN cargo build -p plane --release --locked

Expand Down
7 changes: 7 additions & 0 deletions plane/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use anyhow::{anyhow, Context, Result};
use clap::{Parser, Subcommand};
use colored::Colorize;
use plane::admin::AdminOpts;
use plane::client::PlaneClient;
use plane::controller::run_controller;
Expand All @@ -13,6 +14,7 @@ use plane::init_tracing::init_tracing;
use plane::names::{AcmeDnsServerName, ControllerName, DroneName, Name, OrRandom, ProxyName};
use plane::proxy::{run_proxy, AcmeConfig, ServerPortConfig};
use plane::types::ClusterName;
use plane::{PLANE_GIT_HASH, PLANE_VERSION};
use std::net::IpAddr;
use std::path::PathBuf;
use url::Url;
Expand Down Expand Up @@ -119,6 +121,7 @@ enum Command {
db: String,
},
Admin(AdminOpts),
Version,
}

async fn run(opts: Opts) -> Result<()> {
Expand Down Expand Up @@ -257,6 +260,10 @@ async fn run(opts: Opts) -> Result<()> {
Command::Admin(admin_opts) => {
plane::admin::run_admin_command(admin_opts).await;
}
Command::Version => {
println!("Client version: {}", PLANE_VERSION.bright_white());
println!("Client hash: {}", PLANE_GIT_HASH.bright_white());
}
}

Ok(())
Expand Down

0 comments on commit 71d9765

Please sign in to comment.