fix(cli): simplify running the CLI by hiding the maestro init inside the implemtation
All checks were successful
Run Check Script / check (pull_request) Successful in -31s

This commit is contained in:
Ian Letourneau
2025-07-31 15:37:06 -04:00
parent 06aab1f57f
commit 4ac74bc862
9 changed files with 67 additions and 62 deletions

View File

@@ -2,24 +2,15 @@ use std::{path::PathBuf, sync::Arc};
use harmony::{
inventory::Inventory,
maestro::Maestro,
modules::application::{
ApplicationScore, RustWebFramework, RustWebapp,
features::{ContinuousDelivery, Monitoring},
},
topology::{K8sAnywhereTopology, Url},
};
use harmony_cli::cli_logger;
#[tokio::main]
async fn main() {
let cli_logger_handle = cli_logger::init();
let topology = K8sAnywhereTopology::from_env();
let mut maestro = Maestro::initialize(Inventory::autoload(), topology)
.await
.unwrap();
let application = Arc::new(RustWebapp {
name: "harmony-example-rust-webapp".to_string(),
domain: Url::Url(url::Url::parse("https://rustapp.harmony.example.com").unwrap()),
@@ -39,8 +30,12 @@ async fn main() {
application,
};
maestro.register_all(vec![Box::new(app)]);
harmony_cli::init(maestro, None).await.unwrap();
let _ = tokio::try_join!(cli_logger_handle);
harmony_cli::run(
K8sAnywhereTopology::from_env(),
Inventory::autoload(),
vec![Box::new(app)],
None,
)
.await
.unwrap();
}