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:
2024-11-27 17:55:45 +01:00
parent 3077420db2
commit e7308bd5c6
4 changed files with 23 additions and 16 deletions

View File

@@ -12,8 +12,10 @@ pub fn down() -> Result<()> {
}
pub fn exec(rest: &[String]) -> Result<()> {
let container = std::env::var("AHAB_DJANGO_CONTAINER").unwrap_or("appserver".to_string());
CommandBuilder::docker_compose()
.args("exec appserver")
.args("exec")
.args(&container)
.args(rest)
.exec()
}