From 34a2d46254f2e3bc5b249ac48719896cee1f2639 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Wed, 6 Aug 2025 22:50:46 +0200 Subject: [PATCH] feat: without legacy Signed-off-by: kjuulh --- crates/cuddle-rust-service-plan/src/main.rs | 74 +-------------------- 1 file changed, 2 insertions(+), 72 deletions(-) diff --git a/crates/cuddle-rust-service-plan/src/main.rs b/crates/cuddle-rust-service-plan/src/main.rs index 5a7e8c7..2e09e89 100644 --- a/crates/cuddle-rust-service-plan/src/main.rs +++ b/crates/cuddle-rust-service-plan/src/main.rs @@ -38,88 +38,18 @@ async fn main() -> eyre::Result<()> { .with_mold("2.3.3") .to_owned(); - let render = &RustServiceRender { - service: cuddle_file.vars.service.clone(), - //registry: "http://127.0.0.1:7900".into(), - //registry: "http://10.0.11.19:7900".into(), - registry: "https://releaser.i.kjuulh.io:443".into(), - }; let deployment = &CuddleReleaser::new(client.clone()).await?; let mut ci = CuddleCI::default(); ci.with_pull_request(service) - .with_pull_request(render) .with_main(service) - .with_main(render) - .with_main(deployment) - .with_release(service); + .with_main(deployment); if cuddle_file.please.is_some() { ci.with_main(&CuddlePlease::new(client.clone())); } - let name = cuddle_file.vars.service.clone(); - let system_time = SystemTime::now().duration_since(UNIX_EPOCH)?; - let build_notifications = client - .container() - .from("docker.io/kasperhermansen/build-notifications:main-1731768496") - .with_env_variable("TIME", system_time.as_secs().to_string()) - .with_env_variable( - "SERVICE_HOST", - "https://build-notifications.prod.internal.kjuulh.app", - ) - .with_env_variable( - "SERVICE_GRPC_HOST", - "https://grpc.build-notifications.prod.internal.kjuulh.app", - ); - - if let Err(e) = build_notifications - .with_exec(vec![ - "build-notifications", - "build-started", - "--project-name", - &name, - ]) - .sync() - .await - { - tracing::warn!("failed to send start notification: {}", e.to_string()) - } - - match ci.execute(std::env::args()).await { - Ok(()) => { - if let Err(e) = build_notifications - .with_exec(vec![ - "build-notifications", - "build-success", - "--project-name", - &name, - ]) - .sync() - .await - { - tracing::warn!("failed to send success notification: {}", e.to_string()) - } - } - Err(e) => { - if let Err(e) = build_notifications - .with_exec(vec![ - "build-notifications", - "build-failure", - "--project-name", - &name, - "--error", - &e.to_string(), - ]) - .sync() - .await - { - tracing::warn!("failed to send failure notification: {}", e.to_string()) - } - - return Err(e); - } - } + ci.execute(std::env::args()).await?; Ok(()) })