forked from NationTech/harmony
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:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user