diff --git a/crates/cuddle-rust-service-plan/src/main.rs b/crates/cuddle-rust-service-plan/src/main.rs index 301e86b..abc78e4 100644 --- a/crates/cuddle-rust-service-plan/src/main.rs +++ b/crates/cuddle-rust-service-plan/src/main.rs @@ -6,7 +6,7 @@ use cuddle_ci::cuddle_releaser::CuddleReleaser; use cuddle_ci::rust_service::architecture::{Architecture, Os}; use cuddle_ci::rust_service::RustService; use cuddle_ci::rust_service::{extensions::*, RustServiceContext}; -use cuddle_ci::{Context, CuddleCI, MainAction}; +use cuddle_ci::{Context, CuddleCI, MainAction, PullRequestAction}; use tokio::sync::Mutex; #[tokio::main] @@ -32,6 +32,9 @@ async fn main() -> eyre::Result<()> { let deployment = Arc::new(Mutex::new(CuddleReleaser::new(client).await?)); CuddleCI::default() + .with_pull_request(service.clone()) + //.with_pull_request(render.clone()) + //.with_pull_request(deployment.clone()) .with_main(service.clone()) .with_main(render.clone()) .with_main(deployment.clone()) @@ -62,3 +65,22 @@ impl MainAction for RustServiceRender { Ok(()) } } + +#[async_trait] +impl PullRequestAction for RustServiceRender { + async fn execute_pull_request(&self, ctx: &mut Context) -> eyre::Result<()> { + let image_tag = ctx + .get_image_tag()? + .ok_or(eyre::anyhow!("failed to find image_tag"))?; + + cuddle_ci::cuddle_x::well_known::render(vec![ + "--cluster", + "clank-dev", + "--image_tag", + &image_tag, + ]) + .await?; + + Ok(()) + } +}