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
2 changes: 1 addition & 1 deletion ci/test/magento/deploy_brancher.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@

$productionStage = $configuration->addStage('test', 'banaan.store');
$productionStage->addBrancherServer('hndeployintegr8')
->setLabels(['gitref='.\getenv('GITHUB_SHA') ?: 'unknown']);
->setLabels(['gitref='. (\getenv('GITHUB_SHA') ?: 'unknown')]);

return $configuration;
2 changes: 1 addition & 1 deletion ci/test/run-brancher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -x

# Handy aliases
HN="ssh app@hndeployintegr8.hypernode.io -o StrictHostKeyChecking=no"
DP="docker run --rm -v /tmp/m2build:/web -e HYPERNODE_API_TOKEN -e SSH_PRIVATE_KEY -w /web hndeploy"
DP="docker run --rm -v /tmp/m2build:/web -e HYPERNODE_API_TOKEN -e SSH_PRIVATE_KEY -e GITHUB_SHA -w /web hndeploy"

# Build Docker image
docker build \
Expand Down
17 changes: 15 additions & 2 deletions src/DeployRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,23 @@ private function maybeConfigureBrancherServer(Server $server): void
$isBrancher = $serverOptions[Server::OPTION_HN_BRANCHER] ?? false;
$parentApp = $serverOptions[Server::OPTION_HN_PARENT_APP] ?? null;
if ($isBrancher && $parentApp) {
$settings = $serverOptions[Server::OPTION_HN_BRANCHER_SETTINGS] ?? [];
$labels = $serverOptions[Server::OPTION_HN_BRANCHER_LABELS] ?? [];

$this->log->info(sprintf('Creating an brancher Hypernode based on %s.', $parentApp));
if ($settings) {
$this->log->info(
sprintf('Settings to be applied: [%s].', implode(', ', $settings))
);
}
if ($labels) {
$this->log->info(
sprintf('Labels to be applied: [%s].', implode(', ', $labels))
);
}

$data = $serverOptions[Server::OPTION_HN_BRANCHER_SETTINGS] ?? [];
$data['labels'] = $serverOptions[Server::OPTION_HN_BRANCHER_LABELS] ?? [];
$data = $settings;
$data['labels'] = $labels;
$brancherApp = $this->brancherHypernodeManager->createForHypernode($parentApp, $data);

$this->log->info(sprintf('Successfully requested brancher Hypernode, name is %s.', $brancherApp));
Expand Down