Implemented fresh configuration loader

* Fresh can now identify and load freshdocker.conf config files
This commit is contained in:
2022-03-21 01:00:00 +01:00
parent 214db1cee3
commit fb0954b4dd
3 changed files with 35 additions and 1 deletions

View File

@ -297,12 +297,37 @@ class Refresher
$this->config = new ComposeConfiguration($configFile);
return;
}
if (basename($configFile) == "freshdocker.conf") {
$this->log->append("Using configuration file ".$this->path."/freshdocker.conf");
$this->config = new LocalConfiguration($this->path."/freshdocker.conf");
return;
}
} else {
if (file_exists($this->path."/docker-compose.yml")) {
$this->log->append("Using configuration file ".$this->path."/docker-compose.yml");
$this->config = new ComposeConfiguration($this->path."/docker-compose.yml");
return;
}
if (file_exists($this->path."/freshdocker.conf")) {
$this->log->append("Using configuration file ".$this->path."/freshdocker.conf");
$this->config = new LocalConfiguration($this->path."/freshdocker.conf");
return;
}
}
break;
case 'fresh':
if ($configFile) {
if (basename($configFile) == "freshdocker.confl") {
$this->log->append("Using configuration file ".$configFile);
$this->config = new LocalConfiguration($configFile);
return;
}
} else {
if (file_exists($this->path."/freshdocker.conf")) {
$this->log->append("Using configuration file ".$this->path."/freshdocker.conf");
$this->config = new LocalConfiguration($this->path."/freshdocker.conf");
return;
}
}
break;
case 'compose':