Skip to content

Commit

Permalink
allow "app_api:app:update" for "manual-install"
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Feb 20, 2024
1 parent 4cb42d7 commit 899ed40
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions lib/Command/ExApp/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
return 2;
}
if ($daemonConfig->getAcceptsDeployId() === $this->manualActions->getAcceptsDeployId()) {
$this->logger->error('For "manual-install" deployId update is done manually');

$actionsDeployIds = [
$this->dockerActions->getAcceptsDeployId(),
$this->manualActions->getAcceptsDeployId(),
];
if (!in_array($daemonConfig->getAcceptsDeployId(), $actionsDeployIds)) {
$this->logger->error(sprintf('Daemon config %s actions for %s not found.', $daemonConfig->getName(), $daemonConfig->getAcceptsDeployId()));
if ($outputConsole) {
$output->writeln('For "manual-install" deployId update is done manually');
$output->writeln(sprintf('Daemon config %s actions for %s not found.', $daemonConfig->getName(), $daemonConfig->getAcceptsDeployId()));
}
return 1;
return 2;
}

if ($exApp->getVersion() === $appInfo['version']) {
Expand Down Expand Up @@ -175,12 +180,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$auth,
);
} else {
$this->logger->error(sprintf('Daemon config %s actions for %s not found.', $daemonConfig->getName(), $daemonConfig->getAcceptsDeployId()));
if ($outputConsole) {
$output->writeln(sprintf('Daemon config %s actions for %s not found.', $daemonConfig->getName(), $daemonConfig->getAcceptsDeployId()));
}
$this->exAppService->setStatusError($exApp, 'Daemon actions not found');
return 2;
$this->manualActions->deployExApp($exApp, $daemonConfig);
$exAppUrl = $this->manualActions->resolveExAppUrl(
$appId,
$daemonConfig->getProtocol(),
$daemonConfig->getHost(),
$daemonConfig->getDeployConfig(),
(int) $appInfo['port'],
$auth,
);
}

if (!$this->service->heartbeatExApp($exAppUrl, $auth)) {
Expand Down

0 comments on commit 899ed40

Please sign in to comment.