chore: fmt

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2023-11-25 23:16:21 +01:00
parent 3939940c01
commit 80782e70f9
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
2 changed files with 77 additions and 87 deletions

View File

@ -1,14 +1,13 @@
use async_trait::async_trait;
use dagger_sdk::Container;
use crate::{dagger_middleware::DaggerMiddleware, MainAction, PullRequestAction};
pub type DynMiddleware = Box<dyn DaggerMiddleware + Send + Sync>;
pub enum RustServiceStage {
BeforeDeps(DynMiddleware),
AfterDeps(DynMiddleware),
BeforeBase(DynMiddleware),
AfterBase(DynMiddleware),
BeforeRelease(DynMiddleware),
@ -86,8 +85,6 @@ mod test {
rust_service::{RustService, RustServiceStage},
};
#[tokio::test]
async fn can_build_rust() -> eyre::Result<()> {
let client = dagger_sdk::connect().await?;
@ -95,7 +92,7 @@ mod test {
RustService::from(client.clone())
.with_base_image(client.container().from("rustlang/rust:nightly"))
.with_sqlx()
.with_stage(RustServiceStage::BeforeBase(middleware(|c| async move { Ok(c) }.boxed())))
.with_stage(RustServiceStage::BeforeDeps(middleware(|c| async move { Ok(c) }.boxed())))
.build_release()
.await?;

View File

@ -97,7 +97,8 @@ impl RustBuild {
let mut containers = Vec::new();
for container_image in images {
let container = match &container_image {
let container =
match &container_image {
SlimImage::Debian { image, deps, .. } => {
let target = BuildTarget::from_target(&container_image);
@ -124,11 +125,7 @@ impl RustBuild {
"-p",
bin_name,
])
.file(format!(
"target/{}/release/{}",
target.to_string(),
bin_name
));
.file(format!("target/{}/release/{}", target.to_string(), bin_name));
self.build_debian_image(
bin,
@ -166,11 +163,7 @@ impl RustBuild {
"-p",
bin_name,
])
.file(format!(
"target/{}/release/{}",
target.to_string(),
bin_name
));
.file(format!("target/{}/release/{}", target.to_string(), bin_name));
self.build_alpine_image(
bin,