diff --git a/ci/test/magento/deploy_brancher.php b/ci/test/magento/deploy_brancher.php index 947bf1b..4399a7d 100644 --- a/ci/test/magento/deploy_brancher.php +++ b/ci/test/magento/deploy_brancher.php @@ -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; diff --git a/ci/test/run-brancher.sh b/ci/test/run-brancher.sh index 35e1437..8fa5814 100755 --- a/ci/test/run-brancher.sh +++ b/ci/test/run-brancher.sh @@ -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 \ diff --git a/src/DeployRunner.php b/src/DeployRunner.php index 0e1434a..fa20fd0 100644 --- a/src/DeployRunner.php +++ b/src/DeployRunner.php @@ -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));