feat: add service plan template
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-03-30 16:21:00 +01:00
parent 5e49d71f0f
commit 1582b6b754
4 changed files with 258 additions and 91 deletions

View File

@@ -1,15 +1,18 @@
use std::sync::Arc;
use cuddle_ci::drone_templater::DroneTemplater;
use cuddle_ci::rust_service::architecture::{Architecture, Os};
use cuddle_ci::rust_service::{extensions::*, RustService};
use cuddle_ci::CuddleCI;
use tokio::sync::Mutex;
const BIN_NAME: &str = "cuddle-rust-service-plan";
#[tokio::main]
async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect().await?;
let service = RustService::from(client)
let service = RustService::from(client.clone())
.with_arch(Architecture::Amd64)
.with_os(Os::Linux)
.with_apt(&[
@@ -27,15 +30,22 @@ async fn main() -> eyre::Result<()> {
.with_apt_ca_certificates()
.with_crates(["ci", "crates/*"])
.with_mold("2.3.3")
.with_bin_name("cuddle-rust-service-plan")
.with_bin_name(BIN_NAME)
.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));
CuddleCI::default()
.with_pull_request(service.clone())
.with_main(service.clone())
.with_main(drone_templater.clone())
.execute(std::env::args())
.await?;