diff --git a/Dockerfile b/Dockerfile index fcf476e..fc48849 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ ARG gitcommithash=HEAD RUN git checkout "$gitcommithash" \ && git reset --hard \ -&& echo "pub const GIT_VERSION: &str = \"$(git-rev-parse HEAD)\";" > src/git_version.rs \ +&& echo "pub const GIT_VERSION: Option <&str> = Some (\"$(git-rev-parse HEAD)\");" > src/git_version.rs \ && cargo test --release \ && cargo build --release --bin ptth_relay diff --git a/src/bin/ptth_relay.rs b/src/bin/ptth_relay.rs index ef43258..71314da 100644 --- a/src/bin/ptth_relay.rs +++ b/src/bin/ptth_relay.rs @@ -19,5 +19,7 @@ async fn main () -> Result <(), Box > { toml::from_str (&config_s).expect (&format! ("Can't parse {:?} as TOML", config_file_path)) }; + eprintln! ("ptth_relay Git version: {:?}", ptth::git_version::GIT_VERSION); + ptth::relay::main (config_file).await } diff --git a/src/git_version.rs b/src/git_version.rs new file mode 100644 index 0000000..ff014a3 --- /dev/null +++ b/src/git_version.rs @@ -0,0 +1 @@ +pub const GIT_VERSION: Option <&str> = None; diff --git a/src/lib.rs b/src/lib.rs index a0ba6b2..dddcb52 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,6 +10,7 @@ pub const PTTH_MAGIC_HEADER: &str = "X-PTTH-2LJYXWC4"; // Basically binaries, but in the lib we can do experimental // test stuff like spawn them both in the same process +pub mod git_version; pub mod relay; pub mod server;