dagger-components/crates/cuddle-ci/src/lib.rs
kjuulh 80b99c27a5
Some checks failed
continuous-integration/drone/push Build is failing
feat: with cuddle please
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-12-29 19:43:04 +01:00

49 lines
1.3 KiB
Rust

pub mod cli;
pub mod leptos_service;
pub use cli::*;
pub mod dagger_middleware;
pub mod node_service;
pub mod rust_lib;
pub mod rust_service;
pub mod cuddle_please {
use async_trait::async_trait;
use dagger_cuddle_please::{
models::CuddlePleaseSrcArgs, DaggerCuddlePlease, DaggerCuddlePleaseAction,
};
use crate::{MainAction, PullRequestAction};
pub struct CuddlePlease {
client: dagger_sdk::Query,
}
impl CuddlePlease {
pub fn new(client: dagger_sdk::Query) -> Self {
Self { client }
}
}
#[async_trait]
impl MainAction for CuddlePlease {
async fn execute_main(&self) -> eyre::Result<()> {
let client = self.client.clone();
let action = DaggerCuddlePlease::new(client);
action
.cuddle_please_src(&CuddlePleaseSrcArgs {
cuddle_image: "kasperhermansen/cuddle-please:latest".into(),
server: dagger_cuddle_please::models::SrcServer::Gitea {
token: std::env::var("CUDDLE_PLEASE_TOKEN")
.expect("CUDDLE_PLEASE_TOKEN to be present"),
},
log_level: Some(dagger_cuddle_please::models::LogLevel::Debug),
})
.await?;
Ok(())
}
}
}