mirror of
https://codeberg.org/icewind/haze.git
synced 2026-10-01 08:44:09 +02:00
parent
c5c2bdbf50
commit
125b68e08a
7 changed files with 207 additions and 9 deletions
15
src/cloud.rs
15
src/cloud.rs
|
|
@ -1,16 +1,16 @@
|
|||
use crate::config::{HazeConfig, HazeVolumeConfig};
|
||||
use crate::database::Database;
|
||||
use crate::exec::{exec, exec_io, exec_tty, ExitCode};
|
||||
use crate::exec::{ExitCode, exec, exec_io, exec_tty};
|
||||
use crate::git::{create_worktree, find_app_repo, init_submodules, remove_worktree};
|
||||
use crate::mapping::{for_config, Mapping};
|
||||
use crate::mapping::{Mapping, for_config};
|
||||
use crate::php::PhpVersion;
|
||||
use crate::service::Service;
|
||||
use crate::service::ServiceTrait;
|
||||
use crate::sources::download_nc;
|
||||
use bollard::Docker;
|
||||
use bollard::config::NetworkCreateRequest;
|
||||
use bollard::models::ContainerState;
|
||||
use bollard::query_parameters::{ListContainersOptions, RemoveContainerOptions};
|
||||
use bollard::Docker;
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use flate2::read::GzDecoder;
|
||||
use futures_util::future::try_join_all;
|
||||
|
|
@ -22,8 +22,8 @@ use std::collections::HashMap;
|
|||
use std::fmt::Display;
|
||||
use std::fs;
|
||||
use std::fs::{read_to_string, write};
|
||||
use std::io::{stdout, Cursor, Read, Stdout, Write};
|
||||
use std::iter::{once, Peekable};
|
||||
use std::io::{Cursor, Read, Stdout, Write, stdout};
|
||||
use std::iter::{Peekable, once};
|
||||
use std::net::IpAddr;
|
||||
use std::os::unix::fs::MetadataExt;
|
||||
use std::str::FromStr;
|
||||
|
|
@ -177,6 +177,7 @@ pub struct CloudOptions {
|
|||
pub services: Vec<Service>,
|
||||
pub app_packages: Vec<Utf8PathBuf>,
|
||||
pub version: Option<String>,
|
||||
pub mappings: Vec<Mapping<'static>>,
|
||||
pub detach: bool,
|
||||
}
|
||||
|
||||
|
|
@ -191,6 +192,7 @@ impl CloudOptions {
|
|||
services: vec![],
|
||||
app_packages: vec![],
|
||||
version: None,
|
||||
mappings: vec![],
|
||||
detach: false,
|
||||
}
|
||||
}
|
||||
|
|
@ -243,6 +245,7 @@ impl CloudOptions {
|
|||
.unwrap_or_default(),
|
||||
services,
|
||||
app_packages: app_package,
|
||||
mappings: vec![],
|
||||
version,
|
||||
detach,
|
||||
})
|
||||
|
|
@ -414,6 +417,7 @@ impl Cloud {
|
|||
let mappings = for_config(config)
|
||||
.chain(source_volumes.iter().map(Mapping::from))
|
||||
.chain(app_volumes.iter().map(Mapping::from))
|
||||
.chain(options.mappings.iter().cloned())
|
||||
.collect::<Vec<_>>();
|
||||
for mapping in &mappings {
|
||||
mapping
|
||||
|
|
@ -874,6 +878,7 @@ impl Cloud {
|
|||
db,
|
||||
services: found_services,
|
||||
app_packages: vec![],
|
||||
mappings: vec![],
|
||||
version,
|
||||
detach,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue