1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

Merge pull request #1513 from TorstenDittmann/fix-safe-custom-installation

fix(install): safe installation on custom compose
This commit is contained in:
Eldad A. Fux 2021-08-26 23:50:54 +03:00 committed by GitHub
commit cfe3cc8b9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
;