mirror of
https://github.com/daledavies/jump.git
synced 2026-02-23 14:50:46 +01:00
Add DOCKERONLYSITES option where no sites.json file is required
This commit is contained in:
@@ -159,16 +159,18 @@ class Sites {
|
||||
};
|
||||
|
||||
$allsites = [];
|
||||
// If we have been instructed to only look for sites via docker then
|
||||
// don't worry about loading a local sites.json file and just
|
||||
// return an empty $allsites array.
|
||||
if ($this->config->get('dockeronlysites')) {
|
||||
if (!$docker()) {
|
||||
throw new ConfigException('DOCKERONLYSITES is specified but no Docker endpoint has been provided');
|
||||
}
|
||||
return $allsites;
|
||||
}
|
||||
// Try to load the sites.json file.
|
||||
$rawjson = @file_get_contents($this->sitesfilelocation);
|
||||
if ($rawjson === false) {
|
||||
// If we have been instructed to look for docker sites then
|
||||
// don't worry about not having a local sites.json file and just
|
||||
// return an empty $allsites array.
|
||||
if ($docker()) {
|
||||
return $allsites;
|
||||
}
|
||||
// If we are not supposed to have docker sites then complau=in about
|
||||
// not being able to load a sites.json.
|
||||
throw new ConfigException('There was a problem loading the sites.json file');
|
||||
}
|
||||
if ($rawjson === '') {
|
||||
|
||||
@@ -74,6 +74,9 @@ return [
|
||||
// Duration to cache status in minutes.
|
||||
'statuscache' => getenv('STATUSCACHE') ?: '5',
|
||||
|
||||
// Only try to look for sites via Docker rather than first trying to load
|
||||
// the sites.json file.
|
||||
'dockeronlysites' => getenv('DOCKERONLYSITES') ?: false,
|
||||
// The URL and port on which a docker socket proxy is listening, for example
|
||||
// if you have tecnativa/docker-socket-proxy named dockerproxy listening on
|
||||
// port 2375 then this would be "dockerproxy:2375".
|
||||
|
||||
Reference in New Issue
Block a user