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:
@@ -63,8 +63,9 @@ pub fn make_command(app: &PathBuf, name: &str) -> Result<()> {
|
||||
|
||||
pub fn manage(rest: &[String]) -> Result<()> {
|
||||
let dsm = get_django_settings_module()?;
|
||||
let container = env::var("AHAB_DJANGO_CONTAINER").unwrap_or("appserver".to_string());
|
||||
let joined = rest.join(" ");
|
||||
let command = format!("run --rm appserver python manage.py {joined} --settings={dsm}");
|
||||
let command = format!("run --rm {container} python manage.py {joined} --settings={dsm}");
|
||||
CommandBuilder::docker_compose().args(&command).exec()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user