feat: use new dagger connect closure
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-12-26 22:55:14 +01:00
parent 027e375baa
commit ab61a5b89f
3 changed files with 55 additions and 76 deletions

39
Cargo.lock generated
View File

@ -194,7 +194,7 @@ dependencies = [
"cuddle-ci",
"dagger-components",
"dagger-rust",
"dagger-sdk 0.9.8",
"dagger-sdk",
"eyre",
"tokio",
]
@ -309,7 +309,7 @@ dependencies = [
"clap",
"dagger-cuddle-please",
"dagger-rust",
"dagger-sdk 0.13.7",
"dagger-sdk",
"eyre",
"futures",
"serde",
@ -328,7 +328,7 @@ dependencies = [
"cuddle-ci",
"dagger-components",
"dagger-rust",
"dagger-sdk 0.9.8",
"dagger-sdk",
"eyre",
"tokio",
]
@ -344,7 +344,7 @@ version = "0.3.0"
source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#2d48b523c31a48feef330673baf05a6d93e7e6ad"
dependencies = [
"async-trait",
"dagger-sdk 0.13.7",
"dagger-sdk",
"eyre",
]
@ -354,40 +354,11 @@ version = "0.3.0"
source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#2d48b523c31a48feef330673baf05a6d93e7e6ad"
dependencies = [
"async-trait",
"dagger-sdk 0.13.7",
"dagger-sdk",
"eyre",
"tokio",
]
[[package]]
name = "dagger-sdk"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79bc59868e62ea1451f158aeb8fbb36c5dd2fb098f31bf408dbd165251674edf"
dependencies = [
"async-trait",
"base64",
"derive_builder",
"dirs",
"eyre",
"flate2",
"futures",
"graphql_client",
"hex",
"hex-literal",
"platform-info",
"reqwest",
"serde",
"serde_json",
"sha2",
"tar",
"tempfile",
"thiserror",
"tokio",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "dagger-sdk"
version = "0.13.7"

View File

@ -7,8 +7,7 @@ const BIN_NAME: &str = "cuddle-node-service-plan";
#[tokio::main]
async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect().await?;
dagger_sdk::connect(|client| async move {
let service = &RustService::from(client.clone())
.with_arch(Architecture::Amd64)
.with_os(Os::Linux)
@ -31,7 +30,8 @@ async fn main() -> eyre::Result<()> {
.with_deployment(false)
.to_owned();
let drone_templater = &DroneTemplater::new(client, "templates/cuddle-node-service-plan.yaml")
let drone_templater =
&DroneTemplater::new(client, "templates/cuddle-node-service-plan.yaml")
.with_variable("bin_name", BIN_NAME)
.to_owned();
@ -42,5 +42,9 @@ async fn main() -> eyre::Result<()> {
.execute(std::env::args())
.await?;
Ok(())
})
.await?;
Ok(())
}

View File

@ -5,7 +5,7 @@ use cuddle_ci::CuddleCI;
#[tokio::main]
async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect().await?;
dagger_sdk::connect(|client| async move {
let cuddle_file = CuddleFile::from_cuddle_file().await?;
let service = &NodeService::new(client.clone(), &cuddle_file.vars.service)
@ -19,5 +19,9 @@ async fn main() -> eyre::Result<()> {
.execute(std::env::args())
.await?;
Ok(())
})
.await?;
Ok(())
}