refact: Make RustWebappScore generic, it is now Application score and takes an application and list of features to attach to the application

This commit is contained in:
2025-07-04 10:27:16 -04:00
parent 6149249a6c
commit b4534c6ee0
5 changed files with 36 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ use harmony::{
inventory::Inventory,
maestro::Maestro,
modules::application::{
RustWebFramework, RustWebapp, RustWebappScore, features::ContinuousDelivery,
ApplicationScore, RustWebFramework, RustWebapp, features::ContinuousDelivery,
},
topology::{K8sAnywhereTopology, Url},
};
@@ -12,18 +12,20 @@ use harmony::{
#[tokio::main]
async fn main() {
env_logger::init();
let application = RustWebapp {
let application = Arc::new(RustWebapp {
name: "harmony-example-rust-webapp".to_string(),
domain: Url::Url(url::Url::parse("https://rustapp.harmony.example.com").unwrap()),
project_root: PathBuf::from("./examples/rust/webapp"),
framework: Some(RustWebFramework::Leptos),
};
// TODO RustWebappScore should simply take a RustWebApp as config
let app = RustWebappScore {
name: "Example Rust Webapp".to_string(),
domain: Url::Url(url::Url::parse("https://rustapp.harmony.example.com").unwrap()),
features: vec![Box::new(ContinuousDelivery {
application: Arc::new(application.clone()),
})],
});
let app = ApplicationScore {
features: vec![
Box::new(ContinuousDelivery {
application: application.clone(),
}),
// TODO add monitoring, backups, multisite ha, etc
],
application,
};