Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
a5d08f4a0d
commit
62f66452c2
@ -402,6 +402,7 @@ pub mod architecture {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mod apt;
|
mod apt;
|
||||||
|
mod apt_ca_certificates;
|
||||||
mod cargo_binstall;
|
mod cargo_binstall;
|
||||||
mod cargo_clean;
|
mod cargo_clean;
|
||||||
mod clap_sanity_test;
|
mod clap_sanity_test;
|
||||||
@ -410,6 +411,7 @@ mod sqlx;
|
|||||||
|
|
||||||
pub mod extensions {
|
pub mod extensions {
|
||||||
pub use super::apt::*;
|
pub use super::apt::*;
|
||||||
|
pub use super::apt_ca_certificates::*;
|
||||||
pub use super::cargo_binstall::*;
|
pub use super::cargo_binstall::*;
|
||||||
pub use super::cargo_clean::*;
|
pub use super::cargo_clean::*;
|
||||||
pub use super::clap_sanity_test::*;
|
pub use super::clap_sanity_test::*;
|
||||||
|
49
crates/cuddle-ci/src/rust_service/apt_ca_certificates.rs
Normal file
49
crates/cuddle-ci/src/rust_service/apt_ca_certificates.rs
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use async_trait::async_trait;
|
||||||
|
use dagger_sdk::Container;
|
||||||
|
|
||||||
|
use crate::dagger_middleware::DaggerMiddleware;
|
||||||
|
|
||||||
|
use super::RustService;
|
||||||
|
|
||||||
|
pub struct AptCaCertificates {}
|
||||||
|
|
||||||
|
impl AptCaCertificates {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
|
impl DaggerMiddleware for AptCaCertificates {
|
||||||
|
async fn handle(&self, container: Container) -> eyre::Result<Container> {
|
||||||
|
let c = container
|
||||||
|
.with_exec(vec![
|
||||||
|
"apt",
|
||||||
|
"install",
|
||||||
|
"-y",
|
||||||
|
"ca-certificates",
|
||||||
|
"build-essential",
|
||||||
|
"curl",
|
||||||
|
"libssl-dev",
|
||||||
|
])
|
||||||
|
.with_exec(vec!["update-ca-certificates"]);
|
||||||
|
|
||||||
|
Ok(c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait AptCaCertificatesExt {
|
||||||
|
fn with_apt_ca_certificates(&mut self, deps: &[&str]) -> &mut Self {
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AptCaCertificatesExt for RustService {
|
||||||
|
fn with_apt_ca_certificates(&mut self, deps: &[&str]) -> &mut Self {
|
||||||
|
self.with_stage(super::RustServiceStage::BeforeDeps(Arc::new(
|
||||||
|
AptCaCertificates::new(),
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user