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 197140d6973e22a6b891ebc0f1798d60c87b182a. * Modify fallback to have crate version
This commit is contained in:
parent
bae4835308
commit
f631155304
23
Cargo.lock
generated
23
Cargo.lock
generated
@ -2019,6 +2019,28 @@ version = "0.21.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c"
|
checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "git-version"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "94918e83f1e01dedc2e361d00ce9487b14c58c7f40bab148026fa39d42cb41e2"
|
||||||
|
dependencies = [
|
||||||
|
"git-version-macro",
|
||||||
|
"proc-macro-hack",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "git-version-macro"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "34a97a52fdee1870a34fa6e4b77570cba531b27d1838874fef4429a791a3d657"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-hack",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glob"
|
name = "glob"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
@ -2902,6 +2924,7 @@ dependencies = [
|
|||||||
"environment",
|
"environment",
|
||||||
"eth2_testnet_config",
|
"eth2_testnet_config",
|
||||||
"futures 0.3.5",
|
"futures 0.3.5",
|
||||||
|
"git-version",
|
||||||
"logging",
|
"logging",
|
||||||
"slog",
|
"slog",
|
||||||
"slog-async",
|
"slog-async",
|
||||||
|
@ -25,6 +25,7 @@ validator_client = { "path" = "../validator_client" }
|
|||||||
account_manager = { "path" = "../account_manager" }
|
account_manager = { "path" = "../account_manager" }
|
||||||
clap_utils = { path = "../common/clap_utils" }
|
clap_utils = { path = "../common/clap_utils" }
|
||||||
eth2_testnet_config = { path = "../common/eth2_testnet_config" }
|
eth2_testnet_config = { path = "../common/eth2_testnet_config" }
|
||||||
|
git-version = "0.3.4"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3.1.0"
|
tempfile = "3.1.0"
|
||||||
|
@ -7,12 +7,18 @@ use clap_utils;
|
|||||||
use env_logger::{Builder, Env};
|
use env_logger::{Builder, Env};
|
||||||
use environment::EnvironmentBuilder;
|
use environment::EnvironmentBuilder;
|
||||||
use eth2_testnet_config::HARDCODED_TESTNET;
|
use eth2_testnet_config::HARDCODED_TESTNET;
|
||||||
|
use git_version::git_version;
|
||||||
use slog::{crit, info, warn};
|
use slog::{crit, info, warn};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use types::EthSpec;
|
use types::EthSpec;
|
||||||
use validator_client::ProductionValidatorClient;
|
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 DEFAULT_DATA_DIR: &str = ".lighthouse";
|
||||||
pub const CLIENT_CONFIG_FILENAME: &str = "beacon-node.toml";
|
pub const CLIENT_CONFIG_FILENAME: &str = "beacon-node.toml";
|
||||||
pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.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() {
|
fn main() {
|
||||||
// Parse the CLI parameters.
|
// Parse the CLI parameters.
|
||||||
let matches = App::new("Lighthouse")
|
let matches = App::new("Lighthouse")
|
||||||
.version(crate_version!())
|
.version(VERSION)
|
||||||
.author("Sigma Prime <contact@sigmaprime.io>")
|
.author("Sigma Prime <contact@sigmaprime.io>")
|
||||||
.setting(clap::AppSettings::ColoredHelp)
|
.setting(clap::AppSettings::ColoredHelp)
|
||||||
.about(
|
.about(
|
||||||
|
Loading…
Reference in New Issue
Block a user