Refactor container definitions
This commit is contained in:
@@ -4,10 +4,11 @@ use tokio::signal::unix::{SignalKind, signal};
|
||||
|
||||
use crate::{
|
||||
API_CONFIG_PATH, DB_CONFIG_PATH,
|
||||
agent::{AgentConfigInfoType, AgentContainerInfo, SOCK_NAME},
|
||||
db::DBConfigInfoType,
|
||||
containers::{
|
||||
AgentConfigInfoType, ConfigInfoType, DBConfigInfoType, WithContainer, WithoutContainer,
|
||||
agent::SOCK_NAME,
|
||||
},
|
||||
env::{self, EnvFile},
|
||||
types::{ConfigInfoType, WithContainer, WithoutContainer},
|
||||
};
|
||||
|
||||
// relative to the current working directory
|
||||
@@ -30,7 +31,10 @@ pub fn write_env_files(db_config: &DBConfigInfoType, agent_config: &Option<Agent
|
||||
DBConfigInfoType::PreExisting(config) => (config.db_type.clone(), config.url.clone()),
|
||||
};
|
||||
|
||||
let mut api_env = EnvFile::new(env::EnvFileType::Yaml, db_type, db_url);
|
||||
let mut api_env = EnvFile::new(env::EnvFileType::Yaml);
|
||||
api_env.write_line("DATABASE__TYPE", db_type.to_string().as_str());
|
||||
api_env.write_line("DATABASE__URL", db_url.as_str());
|
||||
|
||||
let mut db_env = api_env.clone();
|
||||
db_env.file_type = env::EnvFileType::DotEnv;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user