feat: control default services via env vars
Read default postgres compose service name and default django compose service name from env variables. AHAB_POSTGRES_CONTAINER - defaults to `appserver` AHAB_DJANGO_CONATINER - defaults to `postgresdb` Default values are there for 100% backwards compatibility.
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -36,9 +36,13 @@ fn main() -> Result<()> {
|
||||
cli::Django::Shell => scripts::django::shell(),
|
||||
cli::Django::Test => scripts::django::test(),
|
||||
},
|
||||
cli::Commands::Postgres { command } => match command {
|
||||
cli::Postgres::Import { path } => scripts::postgres::import(&path),
|
||||
cli::Postgres::Dump { path } => scripts::postgres::dump(&path),
|
||||
},
|
||||
cli::Commands::Postgres { command } => {
|
||||
let db_container =
|
||||
std::env::var("AHAB_POSTGRES_CONTAINER").unwrap_or("postgresdb".to_string());
|
||||
match command {
|
||||
cli::Postgres::Import { path } => scripts::postgres::import(&db_container, &path),
|
||||
cli::Postgres::Dump { path } => scripts::postgres::dump(&db_container, &path),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user