diff --git a/Cargo.lock b/Cargo.lock index 36d53d9..f2b3732 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "cuddle-ci" version = "0.2.0" -source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#823712e2bf4be5b8e740e529898eab5ab67f2419" +source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#99bc420f71d3721e9ba4bd79a06ac91617739970" dependencies = [ "async-trait", "chrono", @@ -341,12 +341,12 @@ dependencies = [ [[package]] name = "dagger-components" version = "0.1.0" -source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#823712e2bf4be5b8e740e529898eab5ab67f2419" +source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#99bc420f71d3721e9ba4bd79a06ac91617739970" [[package]] name = "dagger-cuddle-please" version = "0.2.0" -source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#823712e2bf4be5b8e740e529898eab5ab67f2419" +source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#99bc420f71d3721e9ba4bd79a06ac91617739970" dependencies = [ "async-trait", "dagger-sdk", @@ -356,7 +356,7 @@ dependencies = [ [[package]] name = "dagger-rust" version = "0.2.0" -source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#823712e2bf4be5b8e740e529898eab5ab67f2419" +source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#99bc420f71d3721e9ba4bd79a06ac91617739970" dependencies = [ "async-trait", "dagger-sdk", diff --git a/ci/src/main.rs b/ci/src/main.rs index ac39b88..3d1ef73 100644 --- a/ci/src/main.rs +++ b/ci/src/main.rs @@ -12,7 +12,7 @@ const BIN_NAME: &str = "cuddle-rust-service-plan"; async fn main() -> eyre::Result<()> { let client = dagger_sdk::connect().await?; - let service = RustService::from(client.clone()) + let service = &RustService::from(client.clone()) .with_arch(Architecture::Amd64) .with_os(Os::Linux) .with_apt(&[ @@ -34,18 +34,14 @@ async fn main() -> eyre::Result<()> { .with_deployment(false) .to_owned(); - let drone_templater = Arc::new(Mutex::new( - DroneTemplater::new(client, "templates/cuddle-rust-service-plan.yaml") - .with_variable("bin_name", BIN_NAME) - .to_owned(), - )); - - let service = Arc::new(Mutex::new(service)); + let drone_templater = &DroneTemplater::new(client, "templates/cuddle-rust-service-plan.yaml") + .with_variable("bin_name", BIN_NAME) + .to_owned(); CuddleCI::default() - .with_pull_request(service.clone()) - .with_main(service.clone()) - .with_main(drone_templater.clone()) + .with_pull_request(service) + .with_main(service) + .with_main(drone_templater) .execute(std::env::args()) .await?; diff --git a/crates/cuddle-rust-service-plan/src/main.rs b/crates/cuddle-rust-service-plan/src/main.rs index 0cd1ad9..cdea235 100644 --- a/crates/cuddle-rust-service-plan/src/main.rs +++ b/crates/cuddle-rust-service-plan/src/main.rs @@ -14,7 +14,7 @@ async fn main() -> eyre::Result<()> { let client = dagger_sdk::connect().await?; let cuddle_file = CuddleFile::from_cuddle_file().await?; - let service = RustService::from(client.clone()) + let service = &RustService::from(client.clone()) .with_arch(Architecture::Amd64) .with_os(Os::Linux) .with_apt(&["libssl-dev", "libz-dev", "libpq-dev", "protobuf-compiler"]) @@ -27,25 +27,23 @@ async fn main() -> eyre::Result<()> { .with_deployment(false) .to_owned(); - let service = Arc::new(Mutex::new(service)); + let render = &RustServiceRender::default(); + let deployment = &CuddleReleaser::new(client).await?; - let render = Arc::new(Mutex::new(RustServiceRender::default())); - - let deployment = Arc::new(Mutex::new(CuddleReleaser::new(client).await?)); CuddleCI::default() - .with_pull_request(service.clone()) + .with_pull_request(service) //.with_pull_request(render.clone()) //.with_pull_request(deployment.clone()) - .with_main(service.clone()) - .with_main(render.clone()) - .with_main(deployment.clone()) + .with_main(service) + .with_main(render) + .with_main(deployment) .execute(std::env::args()) .await?; Ok(()) } -#[derive(Default)] +#[derive(Default, Clone)] struct RustServiceRender {} #[async_trait]