feat: with fix
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-02-11 14:13:27 +01:00
parent 5dbaf3c87f
commit 999cc9d59f
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
12 changed files with 34 additions and 17 deletions

View File

@ -368,7 +368,7 @@ impl MainAction for LeptosService {
.container() .container()
.from(update_deployments_docker_image); .from(update_deployments_docker_image);
let dep = if let Some(sock) = std::env::var("SSH_AUTH_SOCK").ok() { let dep = if let Ok(sock) = std::env::var("SSH_AUTH_SOCK") {
dep.with_unix_socket("/tmp/ssh_sock", self.client.host().unix_socket(sock)) dep.with_unix_socket("/tmp/ssh_sock", self.client.host().unix_socket(sock))
.with_env_variable("SSH_AUTH_SOCK", "/tmp/ssh_sock") .with_env_variable("SSH_AUTH_SOCK", "/tmp/ssh_sock")
.with_exec(vec![ .with_exec(vec![

View File

@ -1,13 +1,12 @@
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf};
use async_trait::async_trait; use async_trait::async_trait;
use dagger_rust::source::RustSource; use dagger_rust::source::RustSource;
use dagger_sdk::Container; use dagger_sdk::Container;
use futures::{stream, StreamExt}; use futures::{StreamExt};
use crate::{ use crate::{
cli, cli,
dagger_middleware::{DaggerMiddleware, DynMiddleware},
rust_service::architecture::{Architecture, Os}, rust_service::architecture::{Architecture, Os},
MainAction, PullRequestAction, MainAction, PullRequestAction,
}; };

View File

@ -11,6 +11,12 @@ pub struct Apt {
deps: Vec<String>, deps: Vec<String>,
} }
impl Default for Apt {
fn default() -> Self {
Self::new()
}
}
impl Apt { impl Apt {
pub fn new() -> Self { pub fn new() -> Self {
Self { deps: Vec::new() } Self { deps: Vec::new() }

View File

@ -9,6 +9,12 @@ use super::RustService;
pub struct AptCaCertificates {} pub struct AptCaCertificates {}
impl Default for AptCaCertificates {
fn default() -> Self {
Self::new()
}
}
impl AptCaCertificates { impl AptCaCertificates {
pub fn new() -> Self { pub fn new() -> Self {
Self {} Self {}

View File

@ -1,7 +1,7 @@
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf, sync::Arc};
use async_trait::async_trait; use async_trait::async_trait;
use dagger_sdk::{Container, HostDirectoryOpts, HostDirectoryOptsBuilder}; use dagger_sdk::{Container};
use crate::{dagger_middleware::DaggerMiddleware, leptos_service::LeptosService}; use crate::{dagger_middleware::DaggerMiddleware, leptos_service::LeptosService};
@ -37,8 +37,8 @@ impl DaggerMiddleware for Assets {
.fold(container, |container, (src_asset_path, dest_asset_path)| { .fold(container, |container, (src_asset_path, dest_asset_path)| {
let src_path = src_asset_path.display().to_string(); let src_path = src_asset_path.display().to_string();
let dest_path = dest_asset_path.display().to_string(); let dest_path = dest_asset_path.display().to_string();
let path = self.client.host().directory(&src_path); let path = self.client.host().directory(src_path);
container.with_directory(&dest_path, path) container.with_directory(dest_path, path)
}); });
Ok(container) Ok(container)

View File

@ -9,6 +9,12 @@ use super::RustService;
pub struct CargoClean; pub struct CargoClean;
impl Default for CargoClean {
fn default() -> Self {
Self::new()
}
}
impl CargoClean { impl CargoClean {
pub fn new() -> Self { pub fn new() -> Self {
Self {} Self {}

View File

@ -1,7 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait; use async_trait::async_trait;
use dagger_sdk::{Container, ImageMediaTypes}; use dagger_sdk::{Container};
use crate::dagger_middleware::DaggerMiddleware; use crate::dagger_middleware::DaggerMiddleware;

View File

@ -1,7 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait; use async_trait::async_trait;
use dagger_sdk::{Container, ContainerWithNewFileOptsBuilder, Socket}; use dagger_sdk::{Container, ContainerWithNewFileOptsBuilder};
use eyre::Context; use eyre::Context;
use crate::{dagger_middleware::DaggerMiddleware, leptos_service::LeptosService}; use crate::{dagger_middleware::DaggerMiddleware, leptos_service::LeptosService};
@ -30,7 +30,7 @@ impl DaggerMiddleware for SshAgent {
let c = container let c = container
.with_new_file_opts( .with_new_file_opts(
format!(".ssh/config"), ".ssh/config".to_string(),
ContainerWithNewFileOptsBuilder::default() ContainerWithNewFileOptsBuilder::default()
.contents( .contents(
r#" r#"
@ -40,7 +40,7 @@ Host *
"#, "#,
) )
.permissions(0700 as isize) .permissions(0700_isize)
.build()?, .build()?,
) )
.with_unix_socket(&sock_var, socket) .with_unix_socket(&sock_var, socket)

View File

@ -219,7 +219,7 @@ impl HtmxBuild {
) )
.with_directory( .with_directory(
"/mnt/app/target/site", "/mnt/app/target/site",
builder_image.directory(format!("/mnt/src/target/site")), builder_image.directory("/mnt/src/target/site".to_string()),
) )
.with_file( .with_file(
"/mnt/app/Cargo.toml", "/mnt/app/Cargo.toml",

View File

@ -198,7 +198,7 @@ impl LeptosBuild {
) )
.with_directory( .with_directory(
"/mnt/app/target/site", "/mnt/app/target/site",
builder_image.directory(format!("/mnt/src/target/site")), builder_image.directory("/mnt/src/target/site".to_string()),
) )
.with_file( .with_file(
"/mnt/app/Cargo.toml", "/mnt/app/Cargo.toml",

View File

@ -116,7 +116,7 @@ impl RustSource {
.map(|c| format!("**/*{}*", c.replace('-', "_"))) .map(|c| format!("**/*{}*", c.replace('-', "_")))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let original_crates = crates.clone(); let mut original_crates = crates.clone();
original_crates.extend(exclude); original_crates.extend(exclude);
let exclude = original_crates.iter().map(|c| c.as_str()).collect(); let exclude = original_crates.iter().map(|c| c.as_str()).collect();
@ -130,7 +130,7 @@ impl RustSource {
}, },
); );
return Ok(incremental_dir); Ok(incremental_dir)
} }
pub async fn get_rust_skeleton_files( pub async fn get_rust_skeleton_files(
@ -191,7 +191,7 @@ impl RustSource {
} }
directory = create_skeleton_files( directory = create_skeleton_files(
directory, directory,
rust_crate.strip_prefix(source_path).unwrap_or(&rust_crate), rust_crate.strip_prefix(source_path).unwrap_or(rust_crate),
)?; )?;
} }

View File

@ -40,7 +40,7 @@ impl RustTest {
.with_exec(vec!["apt", "update"]) .with_exec(vec!["apt", "update"])
.with_exec(deps); .with_exec(deps);
let target_cache = self.client.cache_volume(format!("rust_target_test",)); let target_cache = self.client.cache_volume("rust_target_test".to_string());
let build_options = vec!["cargo", "build", "--workspace"]; let build_options = vec!["cargo", "build", "--workspace"];
let rust_prebuild = rust_build_image let rust_prebuild = rust_build_image