mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
- Update paths and orchestration for deployers (compose/k8s/local/docker) - Consolidate scripts helpers and refresh book/README docs
32 lines
1.0 KiB
Rust
32 lines
1.0 KiB
Rust
use std::env;
|
|
|
|
use tracing::debug;
|
|
|
|
/// Select the compose image and optional platform, honoring
|
|
/// NOMOS_TESTNET_IMAGE.
|
|
pub fn resolve_image() -> (String, Option<String>) {
|
|
let image = env::var("NOMOS_TESTNET_IMAGE")
|
|
.unwrap_or_else(|_| String::from("logos-blockchain-testing:local"));
|
|
let platform = (image == "ghcr.io/logos-co/nomos:testnet").then(|| "linux/amd64".to_owned());
|
|
debug!(image, platform = ?platform, "resolved compose image");
|
|
(image, platform)
|
|
}
|
|
|
|
/// Optional extra hosts entry for host networking.
|
|
pub fn host_gateway_entry() -> Option<String> {
|
|
if let Ok(value) = env::var("COMPOSE_RUNNER_HOST_GATEWAY") {
|
|
if value.eq_ignore_ascii_case("disable") || value.is_empty() {
|
|
return None;
|
|
}
|
|
return Some(value);
|
|
}
|
|
|
|
if let Ok(gateway) = env::var("DOCKER_HOST_GATEWAY") {
|
|
if !gateway.is_empty() {
|
|
return Some(format!("host.docker.internal:{gateway}"));
|
|
}
|
|
}
|
|
|
|
Some("host.docker.internal:host-gateway".into())
|
|
}
|