kjuulh
c8f56874d0
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
38 lines
1.0 KiB
Rust
38 lines
1.0 KiB
Rust
use async_trait::async_trait;
|
|
use dagger_cuddle_please::{models::CuddlePleaseSrcArgs, DaggerCuddlePlease};
|
|
|
|
use crate::{Context, MainAction};
|
|
|
|
#[derive(Clone)]
|
|
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, _ctx: &mut Context) -> eyre::Result<()> {
|
|
let client = self.client.clone();
|
|
|
|
let action = DaggerCuddlePlease::new(client);
|
|
|
|
action
|
|
.cuddle_please_src(&CuddlePleaseSrcArgs {
|
|
cuddle_image: "kasperhermansen/cuddle-please:main-1712698022".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(())
|
|
}
|
|
}
|