🐳 Add Git version printout when ptth_relay launches

main
_ 2020-11-02 18:07:34 +00:00
parent 04cfaf75e1
commit e99ace3ca0
4 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -19,5 +19,7 @@ async fn main () -> Result <(), Box <dyn Error>> {
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
}

1
src/git_version.rs Normal file
View File

@ -0,0 +1 @@
pub const GIT_VERSION: Option <&str> = None;

View File

@ -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;