Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Commands/ProtocolStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ private function startDirect(string $dir): int
$this->checkDiskSpace();
$this->writeSummary($dir, $ctx);

// Clear cached data so status reads fresh state from disk
Json::clearInstances();

// Run protocol status to show full dashboard
$statusArgs = new ArrayInput(['--dir' => $dir]);
$this->getApplication()->find('status')->run($statusArgs, $this->output);
Expand Down
14 changes: 12 additions & 2 deletions src/Commands/ProtocolStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private function buildContext(InputInterface $input): array
$strategy = $nodeData['deployment']['strategy'] ?? 'none';
$projectName = $nodeData['name'] ?? $nodeConfig;
$releasesDir = $nodeData['bluegreen']['releases_dir'] ?? null;
$currentRelease = $nodeData['release']['current'] ?? null;
$currentRelease = $nodeData['release']['active'] ?? $nodeData['release']['current'] ?? null;
$currentBranch = $nodeData['deployment']['branch'] ?? null;
$awaitingRelease = $nodeData['deployment']['awaiting_release'] ?? false;
$dockerImage = $nodeData['docker']['image'] ?? null;
Expand Down Expand Up @@ -413,6 +413,7 @@ private function renderDocker(array $ctx): void
{
$output = $this->output;
$repo_dir = $ctx['repo_dir'];
$strategy = $ctx['strategy'];
$dockerDir = ($ctx['nodeConfig'] && $ctx['activeDir']) ? $ctx['activeDir'] : $repo_dir;

$containers = ContainerName::resolveAll($repo_dir);
Expand All @@ -421,12 +422,14 @@ private function renderDocker(array $ctx): void
}

$releaseDockerDir = null;
$activeContainerName = null;
if (BlueGreen::isEnabled($repo_dir)) {
$activeVersion = BlueGreen::getActiveVersion($repo_dir);
if ($activeVersion) {
$releaseDir = BlueGreen::getReleaseDir($repo_dir, $activeVersion);
if (is_dir($releaseDir)) {
$releaseDockerDir = $releaseDir;
$activeContainerName = ContainerName::resolveFromDir($releaseDir);
}
}
}
Expand All @@ -446,7 +449,14 @@ private function renderDocker(array $ctx): void
$this->writeService($output, $container, 'running', $stats);
} else {
$this->writeService($output, $container, 'stopped');
$this->issues[] = "Container '{$container}' is not running";
// Only flag as issue if this is the active container or strategy=none
// Old release containers being stopped is expected
$isActiveContainer = ($strategy === 'none')
|| (!$activeContainerName)
|| ($container === $activeContainerName);
if ($isActiveContainer) {
$this->issues[] = "Container '{$container}' is not running";
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Utils/NodeConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public static function resolveActiveDir(array $data): string
{
$strategy = $data['deployment']['strategy'] ?? 'none';
$releasesDir = $data['bluegreen']['releases_dir'] ?? null;
$currentRelease = $data['release']['current'] ?? null;
$currentRelease = $data['release']['active'] ?? $data['release']['current'] ?? null;
$currentBranch = $data['deployment']['branch'] ?? $data['git']['branch'] ?? null;
$projectName = $data['name'] ?? 'unknown';

Expand Down
Loading