2024-03-30 00:09:34 +01:00
|
|
|
|
2024-03-30 15:51:46 +01:00
|
|
|
use cuddle_ci::drone_templater::DroneTemplater;
|
2024-03-30 00:09:34 +01:00
|
|
|
use cuddle_ci::rust_service::architecture::{Architecture, Os};
|
|
|
|
use cuddle_ci::rust_service::{extensions::*, RustService};
|
2024-03-30 23:51:33 +01:00
|
|
|
use cuddle_ci::{CuddleCI};
|
2024-03-30 00:09:34 +01:00
|
|
|
|
2024-03-30 15:51:46 +01:00
|
|
|
const BIN_NAME: &str = "cuddle-rust-cli-plan";
|
|
|
|
|
2024-03-30 00:09:34 +01:00
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> eyre::Result<()> {
|
|
|
|
let client = dagger_sdk::connect().await?;
|
|
|
|
|
2024-03-30 23:51:33 +01:00
|
|
|
let service = &RustService::from(client.clone())
|
2024-03-30 00:09:34 +01:00
|
|
|
.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()
|
2024-03-30 23:51:33 +01:00
|
|
|
.with_workspace_crates()
|
|
|
|
.await
|
2024-03-30 00:09:34 +01:00
|
|
|
.with_mold("2.3.3")
|
2024-03-30 15:51:46 +01:00
|
|
|
.with_bin_name(BIN_NAME)
|
2024-03-30 00:09:34 +01:00
|
|
|
.with_deployment(false)
|
|
|
|
.to_owned();
|
|
|
|
|
2024-03-30 23:51:33 +01:00
|
|
|
let drone_templater = &DroneTemplater::new(client, "templates/cuddle-rust-cli-plan.yaml")
|
|
|
|
.with_variable("bin_name", BIN_NAME)
|
|
|
|
.to_owned();
|
2024-03-30 01:49:18 +01:00
|
|
|
|
2024-03-30 00:09:34 +01:00
|
|
|
CuddleCI::default()
|
2024-03-30 23:51:33 +01:00
|
|
|
.with_pull_request(service)
|
|
|
|
.with_main(service)
|
2024-03-30 01:49:18 +01:00
|
|
|
.with_main(drone_templater)
|
2024-03-30 00:09:34 +01:00
|
|
|
.execute(std::env::args())
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|