Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ private function initContainer(): Container
'version' => $this->getVersion(),
]);

if (!defined('DEPLOYER_VERSION')) {
define("DEPLOYER_VERSION", sprintf("Hypernode Deploy %s", $this->getVersion()));
}

$container = $builder->build();

$this->registerTwigLoader($container);
Expand Down
1 change: 1 addition & 0 deletions src/DeployRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ private function configureStageServer(
$host->setSshMultiplexing(true);
$host->set('roles', $server->getRoles());
$host->set('domain', $stage->getDomain());
$host->set('stage', $stage->getName());
$host->set('deploy_path', function () {
// Ensure directory exists before returning it
run('mkdir -p ~/apps/{{domain}}/shared');
Expand Down
2 changes: 1 addition & 1 deletion src/Deployer/Task/After/SlackTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function supports(TaskConfigurationInterface $config): bool
*/
public function configureWithTaskConfig(TaskConfigurationInterface $config): ?Task
{
$this->recipeLoader->load('slack.php');
$this->recipeLoader->load('../contrib/slack.php');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking it moved in a more recent Deployer version?


set('slack_webhook', $config->getWebHook());
set('slack_text', '{{release_message}}');
Expand Down
14 changes: 12 additions & 2 deletions src/Stdlib/ReleaseInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Hypernode\Deploy\Stdlib;

use Hypernode\DeployConfiguration\Stage;
use Deployer\Exception\RunException;

use function Deployer\get;
use function Deployer\parse;
Expand All @@ -18,7 +19,12 @@ class ReleaseInfo

public function getCommitSha(): string
{
return runLocally('git rev-parse HEAD');
try {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case it's not ran in a git folder

return runLocally('git rev-parse HEAD');
}
catch (\Throwable $e) {
return '';
}
}

public function getMessage(): string
Expand Down Expand Up @@ -52,7 +58,11 @@ public function getMessage(): string
*/
private function branchList(): array
{
$gitLogOutput = runLocally('git log --merges -n 1');
$gitLogOutput = '';
try {
$gitLogOutput = runLocally('git log --merges -n 1');
}
catch (RunException $e) {}

if (!preg_match(self::MERGE_PATTERN, $gitLogOutput, $matches)) {
output()->write('No merge commit found');
Expand Down
Loading