mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 22:46:55 +00:00
Merge pull request #335 from nextcloud/enh/noid/disallow-database-update-if-failed
correctly disable database update if it failed before
This commit is contained in:
commit
6b3cba411e
2 changed files with 17 additions and 14 deletions
|
|
@ -33,9 +33,17 @@ class DockerController
|
||||||
$this->PerformRecursiveContainerStart($dependency);
|
$this->PerformRecursiveContainerStart($dependency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$pullcontainer = true;
|
||||||
|
if ($id === 'nextcloud-aio-database') {
|
||||||
|
if ($this->dockerActionManager->GetDatabasecontainerExitCode() > 0) {
|
||||||
|
$pullcontainer = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->dockerActionManager->DeleteContainer($container);
|
$this->dockerActionManager->DeleteContainer($container);
|
||||||
$this->dockerActionManager->CreateVolumes($container);
|
$this->dockerActionManager->CreateVolumes($container);
|
||||||
$this->dockerActionManager->PullContainer($container);
|
if ($pullcontainer) {
|
||||||
|
$this->dockerActionManager->PullContainer($container);
|
||||||
|
}
|
||||||
$this->dockerActionManager->CreateContainer($container);
|
$this->dockerActionManager->CreateContainer($container);
|
||||||
$this->dockerActionManager->StartContainer($container);
|
$this->dockerActionManager->StartContainer($container);
|
||||||
$this->dockerActionManager->ConnectContainerToNetwork($container);
|
$this->dockerActionManager->ConnectContainerToNetwork($container);
|
||||||
|
|
|
||||||
|
|
@ -261,19 +261,14 @@ class DockerActionManager
|
||||||
|
|
||||||
public function PullContainer(Container $container) : void
|
public function PullContainer(Container $container) : void
|
||||||
{
|
{
|
||||||
$pullcontainer = true;
|
$url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', urlencode($this->BuildImageName($container))));
|
||||||
if ($container->GetIdentifier() === 'nextcloud-aio-database') {
|
try {
|
||||||
if ($this->GetDatabasecontainerExitCode() > 0) {
|
$this->guzzleClient->post($url);
|
||||||
$pullcontainer = false;
|
} catch (RequestException $e) {
|
||||||
}
|
error_log($e->getMessage());
|
||||||
}
|
// Don't exit here because it is possible that the image is already present
|
||||||
if ($pullcontainer) {
|
// and we ran into docker hub limits.
|
||||||
$url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', urlencode($this->BuildImageName($container))));
|
// We will exit later if not image should be available.
|
||||||
try {
|
|
||||||
$this->guzzleClient->post($url);
|
|
||||||
} catch (RequestException $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue