use std::{path::PathBuf, sync::Arc}; use harmony::{ inventory::Inventory, modules::{ application::{ ApplicationScore, RustWebFramework, RustWebapp, features::{Monitoring, PackagingDeployment}, }, monitoring::alert_channel::{ discord_alert_channel::DiscordWebhook, webhook_receiver::WebhookReceiver, }, }, topology::K8sAnywhereTopology, }; use harmony_macros::hurl; #[tokio::main] async fn main() { let application = Arc::new(RustWebapp { name: "harmony-example-rust-webapp".to_string(), project_root: PathBuf::from("./webapp"), framework: Some(RustWebFramework::Leptos), service_port: 3000, }); let discord_receiver = DiscordWebhook { name: "test-discord".to_string(), url: hurl!("https://discord.doesnt.exist.com"), }; let webhook_receiver = WebhookReceiver { name: "sample-webhook-receiver".to_string(), url: hurl!("https://webhook-doesnt-exist.com"), }; let app = ApplicationScore { features: vec![ Box::new(PackagingDeployment { application: application.clone(), }), Box::new(Monitoring { application: application.clone(), alert_receiver: vec![Box::new(discord_receiver), Box::new(webhook_receiver)], }), // TODO add backups, multisite ha, etc ], application, }; harmony_cli::run( Inventory::autoload(), K8sAnywhereTopology::from_env(), vec![Box::new(app)], None, ) .await .unwrap(); }