feat: use new dagger connect closure
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
027e375baa
commit
ab61a5b89f
39
Cargo.lock
generated
39
Cargo.lock
generated
@ -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"
|
||||
|
@ -7,40 +7,44 @@ 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)
|
||||
.with_apt(&[
|
||||
"clang",
|
||||
"libssl-dev",
|
||||
"libz-dev",
|
||||
"libgit2-dev",
|
||||
"git",
|
||||
"openssh-client",
|
||||
])
|
||||
.with_apt_release(&["git", "openssh-client"])
|
||||
.with_docker_cli()
|
||||
.with_cuddle_cli()
|
||||
.with_kubectl()
|
||||
.with_apt_ca_certificates()
|
||||
.with_crates(["ci", "crates/*"])
|
||||
.with_mold("2.3.3")
|
||||
.with_bin_name(BIN_NAME)
|
||||
.with_deployment(false)
|
||||
.to_owned();
|
||||
|
||||
let service = &RustService::from(client.clone())
|
||||
.with_arch(Architecture::Amd64)
|
||||
.with_os(Os::Linux)
|
||||
.with_apt(&[
|
||||
"clang",
|
||||
"libssl-dev",
|
||||
"libz-dev",
|
||||
"libgit2-dev",
|
||||
"git",
|
||||
"openssh-client",
|
||||
])
|
||||
.with_apt_release(&["git", "openssh-client"])
|
||||
.with_docker_cli()
|
||||
.with_cuddle_cli()
|
||||
.with_kubectl()
|
||||
.with_apt_ca_certificates()
|
||||
.with_crates(["ci", "crates/*"])
|
||||
.with_mold("2.3.3")
|
||||
.with_bin_name(BIN_NAME)
|
||||
.with_deployment(false)
|
||||
.to_owned();
|
||||
let drone_templater =
|
||||
&DroneTemplater::new(client, "templates/cuddle-node-service-plan.yaml")
|
||||
.with_variable("bin_name", BIN_NAME)
|
||||
.to_owned();
|
||||
|
||||
let drone_templater = &DroneTemplater::new(client, "templates/cuddle-node-service-plan.yaml")
|
||||
.with_variable("bin_name", BIN_NAME)
|
||||
.to_owned();
|
||||
CuddleCI::default()
|
||||
.with_pull_request(service)
|
||||
.with_main(service)
|
||||
.with_main(drone_templater)
|
||||
.execute(std::env::args())
|
||||
.await?;
|
||||
|
||||
CuddleCI::default()
|
||||
.with_pull_request(service)
|
||||
.with_main(service)
|
||||
.with_main(drone_templater)
|
||||
.execute(std::env::args())
|
||||
.await?;
|
||||
Ok(())
|
||||
})
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -5,19 +5,23 @@ use cuddle_ci::CuddleCI;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> eyre::Result<()> {
|
||||
let client = dagger_sdk::connect().await?;
|
||||
let cuddle_file = CuddleFile::from_cuddle_file().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)
|
||||
.with_arch(Architecture::Amd64)
|
||||
.with_os(Os::Linux)
|
||||
.to_owned();
|
||||
let service = &NodeService::new(client.clone(), &cuddle_file.vars.service)
|
||||
.with_arch(Architecture::Amd64)
|
||||
.with_os(Os::Linux)
|
||||
.to_owned();
|
||||
|
||||
CuddleCI::default()
|
||||
.with_pull_request(service)
|
||||
.with_main(service)
|
||||
.execute(std::env::args())
|
||||
.await?;
|
||||
CuddleCI::default()
|
||||
.with_pull_request(service)
|
||||
.with_main(service)
|
||||
.execute(std::env::args())
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user