Fixed version string
Some checks failed
Build and deploy / Build container and manifests (push) Failing after 4m10s
Some checks failed
Build and deploy / Build container and manifests (push) Failing after 4m10s
This commit is contained in:
parent
7fb8cb9c60
commit
f676455468
|
@ -21,8 +21,10 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
fetch-tags: true
|
fetch-tags: true
|
||||||
|
|
||||||
- name: Get Git commit timestamps
|
- name: Set git based environment variables
|
||||||
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
|
run: |
|
||||||
|
echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
|
||||||
|
echo "RELEASE_VERSION=$(git describe --always --dirty='--modified')" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Login to registry
|
- name: Login to registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
|
@ -67,6 +69,8 @@ jobs:
|
||||||
annotations: ${{ steps.meta.outputs.annotations }}
|
annotations: ${{ steps.meta.outputs.annotations }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
build-args: |
|
||||||
|
"RELEASE_VERSION=${{ env.RELEASE_VERSION }}"
|
||||||
env:
|
env:
|
||||||
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
|
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,9 @@ ENV RUSTC_BOOTSTRAP=1
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
RUN cargo chef cook --release --recipe-path recipe.json
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
ARG RELEASE_VERSION
|
||||||
|
ENV RELEASE_VERSION ${RELEASE_VERSION}
|
||||||
|
# HACK: Enable the use of features on stable
|
||||||
ENV RUSTC_BOOTSTRAP=1
|
ENV RUSTC_BOOTSTRAP=1
|
||||||
RUN cargo auditable build --release
|
RUN cargo auditable build --release
|
||||||
|
|
||||||
|
|
|
@ -5,4 +5,7 @@ mod io;
|
||||||
pub mod ldap;
|
pub mod ldap;
|
||||||
pub mod ssh;
|
pub mod ssh;
|
||||||
pub mod tunnel;
|
pub mod tunnel;
|
||||||
|
mod version;
|
||||||
pub mod web;
|
pub mod web;
|
||||||
|
|
||||||
|
pub use version::VERSION;
|
||||||
|
|
|
@ -3,10 +3,10 @@ use std::path::Path;
|
||||||
|
|
||||||
use color_eyre::eyre::Context;
|
use color_eyre::eyre::Context;
|
||||||
use dotenvy::dotenv;
|
use dotenvy::dotenv;
|
||||||
use git_version::git_version;
|
|
||||||
use hyper::server::conn::http1::{self};
|
use hyper::server::conn::http1::{self};
|
||||||
use hyper_util::rt::TokioIo;
|
use hyper_util::rt::TokioIo;
|
||||||
use rand::rngs::OsRng;
|
use rand::rngs::OsRng;
|
||||||
|
use siranga::VERSION;
|
||||||
use siranga::ldap::Ldap;
|
use siranga::ldap::Ldap;
|
||||||
use siranga::ssh::Server;
|
use siranga::ssh::Server;
|
||||||
use siranga::tunnel::Registry;
|
use siranga::tunnel::Registry;
|
||||||
|
@ -38,11 +38,7 @@ async fn main() -> color_eyre::Result<()> {
|
||||||
.init();
|
.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
info!(
|
info!(version = VERSION, "Starting",);
|
||||||
"Starting {} ({})",
|
|
||||||
std::env!("CARGO_PKG_NAME"),
|
|
||||||
git_version!(),
|
|
||||||
);
|
|
||||||
|
|
||||||
let key = if let Ok(path) = std::env::var("PRIVATE_KEY_FILE") {
|
let key = if let Ok(path) = std::env::var("PRIVATE_KEY_FILE") {
|
||||||
russh::keys::PrivateKey::read_openssh_file(Path::new(&path))
|
russh::keys::PrivateKey::read_openssh_file(Path::new(&path))
|
||||||
|
|
|
@ -4,7 +4,6 @@ use std::iter::once;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use git_version::git_version;
|
|
||||||
use ratatui::layout::{Constraint, Flex, Layout, Position, Rect};
|
use ratatui::layout::{Constraint, Flex, Layout, Position, Rect};
|
||||||
use ratatui::prelude::CrosstermBackend;
|
use ratatui::prelude::CrosstermBackend;
|
||||||
use ratatui::style::{Style, Stylize as _};
|
use ratatui::style::{Style, Stylize as _};
|
||||||
|
@ -18,6 +17,7 @@ use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel};
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
use unicode_width::UnicodeWidthStr;
|
use unicode_width::UnicodeWidthStr;
|
||||||
|
|
||||||
|
use crate::VERSION;
|
||||||
use crate::io::TerminalHandle;
|
use crate::io::TerminalHandle;
|
||||||
use crate::tunnel::{Tunnel, TunnelRow};
|
use crate::tunnel::{Tunnel, TunnelRow};
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ impl RendererInner {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_title(&self, frame: &mut Frame, rect: Rect) {
|
fn render_title(&self, frame: &mut Frame, rect: Rect) {
|
||||||
let title = format!("{} ({})", std::env!("CARGO_PKG_NAME"), git_version!()).bold();
|
let title = format!("{} ({})", std::env!("CARGO_PKG_NAME"), VERSION).bold();
|
||||||
let title = Line::from(title).centered();
|
let title = Line::from(title).centered();
|
||||||
frame.render_widget(title, rect);
|
frame.render_widget(title, rect);
|
||||||
}
|
}
|
||||||
|
|
9
src/version.rs
Normal file
9
src/version.rs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
pub const VERSION: &str = get_version();
|
||||||
|
|
||||||
|
const fn get_version() -> &'static str {
|
||||||
|
if let Some(version) = std::option_env!("RELEASE_VERSION") {
|
||||||
|
version
|
||||||
|
} else {
|
||||||
|
git_version::git_version!()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user