Add latest commit info to git version (#1316)

* Add latest commit info to git version

* Testing docker build

* Use fallback; modify format

* Revert "Testing docker build"

This reverts commit 197140d697.

* Modify fallback to have crate version
This commit is contained in:
Pawan Dhananjay
2020-07-06 14:38:37 +05:30
committed by GitHub
parent bae4835308
commit f631155304
3 changed files with 31 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ validator_client = { "path" = "../validator_client" }
account_manager = { "path" = "../account_manager" }
clap_utils = { path = "../common/clap_utils" }
eth2_testnet_config = { path = "../common/eth2_testnet_config" }
git-version = "0.3.4"
[dev-dependencies]
tempfile = "3.1.0"

View File

@@ -7,12 +7,18 @@ use clap_utils;
use env_logger::{Builder, Env};
use environment::EnvironmentBuilder;
use eth2_testnet_config::HARDCODED_TESTNET;
use git_version::git_version;
use slog::{crit, info, warn};
use std::path::PathBuf;
use std::process::exit;
use types::EthSpec;
use validator_client::ProductionValidatorClient;
pub const VERSION: &str = git_version!(
args = ["--always", "--dirty=(modified)"],
prefix = concat!(crate_version!(), "-"),
fallback = crate_version!()
);
pub const DEFAULT_DATA_DIR: &str = ".lighthouse";
pub const CLIENT_CONFIG_FILENAME: &str = "beacon-node.toml";
pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";
@@ -20,7 +26,7 @@ pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";
fn main() {
// Parse the CLI parameters.
let matches = App::new("Lighthouse")
.version(crate_version!())
.version(VERSION)
.author("Sigma Prime <contact@sigmaprime.io>")
.setting(clap::AppSettings::ColoredHelp)
.about(