feat: update cli plan
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-08-01 23:06:45 +02:00
parent 939c9f8961
commit 951051a4fe
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394
5 changed files with 294 additions and 256 deletions

433
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ edition = "2021"
[dependencies] [dependencies]
tokio.workspace = true tokio.workspace = true
dagger-sdk = "0.9.8" dagger-sdk = "0.11.10"
eyre = { version = "0.6.12" } eyre = { version = "0.6.12" }
dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" } dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }

View File

@ -7,42 +7,44 @@ const BIN_NAME: &str = "cuddle-rust-cli-plan";
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { 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_workspace_crates()
.await
.with_mold("2.3.3")
.with_bin_name(BIN_NAME)
.with_deployment(false)
.with_dagger_bin("0.9.8")
.to_owned();
let service = &RustService::from(client.clone()) let drone_templater = &DroneTemplater::new(client, "templates/cuddle-rust-cli-plan.yaml")
.with_arch(Architecture::Amd64) .with_variable("bin_name", BIN_NAME)
.with_os(Os::Linux) .to_owned();
.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_workspace_crates()
.await
.with_mold("2.3.3")
.with_bin_name(BIN_NAME)
.with_deployment(false)
.with_dagger_bin("0.9.8")
.to_owned();
let drone_templater = &DroneTemplater::new(client, "templates/cuddle-rust-cli-plan.yaml") CuddleCI::default()
.with_variable("bin_name", BIN_NAME) .with_pull_request(service)
.to_owned(); .with_main(service)
.with_main(drone_templater)
CuddleCI::default() .execute(std::env::args())
.with_pull_request(service) .await?;
.with_main(service) Ok(())
.with_main(drone_templater) })
.execute(std::env::args()) .await?;
.await?;
Ok(()) Ok(())
} }

View File

@ -6,7 +6,7 @@ edition = "2021"
[dependencies] [dependencies]
tokio.workspace = true tokio.workspace = true
dagger-sdk = "0.9.8" dagger-sdk = "0.11.10"
eyre = { version = "0.6.12" } eyre = { version = "0.6.12" }
dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" } dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }

View File

@ -6,29 +6,32 @@ use cuddle_ci::{cuddle_please, CuddleCI};
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { 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 cuddle_file = CuddleFile::from_cuddle_file().await?;
let service = &RustService::from(client.clone()) let service = &RustService::from(client.clone())
.with_arch(Architecture::Amd64) .with_arch(Architecture::Amd64)
.with_os(Os::Linux) .with_os(Os::Linux)
.with_apt(&["libssl-dev", "libz-dev", "libpq-dev", "protobuf-compiler"]) .with_apt(&["libssl-dev", "libz-dev", "libpq-dev", "protobuf-compiler"])
.with_apt_release(&["libssl-dev", "libz-dev", "libpq-dev"]) .with_apt_release(&["libssl-dev", "libz-dev", "libpq-dev"])
.with_cuddle_file(&cuddle_file) .with_cuddle_file(&cuddle_file)
.with_apt_ca_certificates() .with_apt_ca_certificates()
.with_workspace_crates() .with_workspace_crates()
.await .await
.with_mold("2.3.3") .with_mold("2.3.3")
.to_owned(); .to_owned();
let cuddle_please = &cuddle_please::CuddlePlease::new(client.clone()); let cuddle_please = &cuddle_please::CuddlePlease::new(client.clone());
CuddleCI::default() CuddleCI::default()
.with_pull_request(service) .with_pull_request(service)
.with_main(service) .with_main(service)
.with_main(cuddle_please) .with_main(cuddle_please)
.execute(std::env::args()) .execute(std::env::args())
.await?; .await?;
Ok(())
})
.await?;
Ok(()) Ok(())
} }