working on ntfy score

This commit is contained in:
tahahawa
2025-06-27 02:28:44 -04:00
parent 80e209d333
commit 6a29969c7f
14 changed files with 797 additions and 231 deletions

12
examples/ntfy/Cargo.toml Normal file
View File

@@ -0,0 +1,12 @@
[package]
name = "example-ntfy"
edition = "2024"
version.workspace = true
readme.workspace = true
license.workspace = true
[dependencies]
harmony = { version = "0.1.0", path = "../../harmony" }
harmony_cli = { version = "0.1.0", path = "../../harmony_cli" }
tokio.workspace = true
url.workspace = true

43
examples/ntfy/src/main.rs Normal file
View File

@@ -0,0 +1,43 @@
use std::{collections::HashMap, str::FromStr};
use harmony::{
inventory::Inventory,
maestro::Maestro,
modules::helm::chart::{HelmChartScore, HelmRepository, NonBlankString},
topology::K8sAnywhereTopology,
};
#[tokio::main]
async fn main() {
let mut ntfy_overrides: HashMap<NonBlankString, String> = HashMap::new();
ntfy_overrides.insert(
NonBlankString::from_str("image.tag").unwrap(),
"v2.12.0".to_string(),
);
let ntfy_chart = HelmChartScore {
namespace: Some(NonBlankString::from_str("monitoring").unwrap()),
release_name: NonBlankString::from_str("ntfy").unwrap(),
chart_name: NonBlankString::from_str("sarab97/ntfy").unwrap(),
chart_version: Some(NonBlankString::from_str("0.1.7").unwrap()),
values_overrides: Some(ntfy_overrides),
values_yaml: None,
create_namespace: true,
install_only: false,
repository: Some(HelmRepository::new(
"sarab97".to_string(),
url::Url::parse("https://charts.sarabsingh.com").unwrap(),
true,
)),
};
let mut maestro = Maestro::<K8sAnywhereTopology>::initialize(
Inventory::autoload(),
K8sAnywhereTopology::from_env(),
)
.await
.unwrap();
maestro.register_all(vec![Box::new(ntfy_chart)]);
harmony_cli::init(maestro, None).await.unwrap();
}