Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
8869b75072
commit
015cb6b23a
@ -1,4 +1,4 @@
|
|||||||
use std::{sync::Arc};
|
use std::sync::Arc;
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
|
||||||
|
@ -334,6 +334,7 @@ pub mod architecture {
|
|||||||
|
|
||||||
mod apt;
|
mod apt;
|
||||||
mod cargo_binstall;
|
mod cargo_binstall;
|
||||||
|
mod cargo_clean;
|
||||||
mod clap_sanity_test;
|
mod clap_sanity_test;
|
||||||
mod mold;
|
mod mold;
|
||||||
mod sqlx;
|
mod sqlx;
|
||||||
@ -341,6 +342,7 @@ mod sqlx;
|
|||||||
pub mod extensions {
|
pub mod extensions {
|
||||||
pub use super::apt::*;
|
pub use super::apt::*;
|
||||||
pub use super::cargo_binstall::*;
|
pub use super::cargo_binstall::*;
|
||||||
|
pub use super::cargo_clean::*;
|
||||||
pub use super::clap_sanity_test::*;
|
pub use super::clap_sanity_test::*;
|
||||||
pub use super::mold::*;
|
pub use super::mold::*;
|
||||||
pub use super::sqlx::*;
|
pub use super::sqlx::*;
|
||||||
|
35
crates/cuddle-ci/src/rust_service/cargo_clean.rs
Normal file
35
crates/cuddle-ci/src/rust_service/cargo_clean.rs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
use dagger_sdk::Container;
|
||||||
|
|
||||||
|
use crate::dagger_middleware::DaggerMiddleware;
|
||||||
|
|
||||||
|
use super::RustService;
|
||||||
|
|
||||||
|
pub struct CargoClean;
|
||||||
|
|
||||||
|
impl CargoClean {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DaggerMiddleware for CargoClean {
|
||||||
|
async fn handle(&self, container: Container) -> eyre::Result<Container> {
|
||||||
|
Ok(container.with_exec(vec!["cargo", "clean"]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait CargoCleanExt {
|
||||||
|
fn with_cargo_clean(&mut self) -> &mut Self {
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CargoCleanExt for RustService {
|
||||||
|
fn with_cargo_clean(&mut self) -> &mut Self {
|
||||||
|
self.with_stage(super::RustServiceStage::BeforeBuild(Box::new(
|
||||||
|
CargoClean::new(),
|
||||||
|
)));
|
||||||
|
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user