use dagger_cuddle_please::{models::CuddlePleaseArgs, DaggerCuddlePleaseAction};

#[tokio::main]
pub async fn main() -> eyre::Result<()> {
    dagger_sdk::connect(|client| async move {
        DaggerCuddlePleaseAction::dagger(client)
            .execute(&CuddlePleaseArgs {
                repository: "dagger-components".into(),
                owner: "kjuulh".into(),
                branch: "main".into(),
                cuddle_image: "kasperhermansen/cuddle-please:latest".into(),
                server: dagger_cuddle_please::models::Server::Gitea {
                    url: "https://git.front.kjuulh.io".into(),
                    user: "git".into(),
                    token: std::env::var("CUDDLE_PLEASE_TOKEN")
                        .expect("CUDDLE_PLEASE_TOKEN to be present"),
                    insecure: None,
                },
                log_level: None,
                use_ssh_socket: false,
            })
            .await?;

        Ok(())
    })
    .await?;
    Ok(())
}
