Merge pull request #1513 from TorstenDittmann/fix-safe-custom-installation
fix(install): safe installation on custom compose
This commit is contained in:
commit
cfe3cc8b9b
|
@ -73,7 +73,15 @@ $cli
|
|||
$compose = new Compose($data);
|
||||
$appwrite = $compose->getService('appwrite');
|
||||
$oldVersion = ($appwrite) ? $appwrite->getImageVersion() : null;
|
||||
$ports = $compose->getService('traefik')->getPorts();
|
||||
try {
|
||||
$ports = $compose->getService('traefik')->getPorts();
|
||||
} catch (\Throwable $th) {
|
||||
$ports = [
|
||||
$defaultHTTPPort => $defaultHTTPPort,
|
||||
$defaultHTTPSPort => $defaultHTTPSPort
|
||||
];
|
||||
Console::warning('Traefik not found. Falling back to default ports.');
|
||||
}
|
||||
|
||||
if($oldVersion) {
|
||||
foreach($compose->getServices() as $service) { // Fetch all env vars from previous compose file
|
||||
|
@ -171,7 +179,7 @@ $cli
|
|||
->setParam('organization', $organization)
|
||||
->setParam('image', $image)
|
||||
;
|
||||
|
||||
|
||||
$templateForEnv
|
||||
->setParam('vars', $input)
|
||||
;
|
||||
|
|
Loading…
Reference in a new issue