Skip to content

Commit

Permalink
Merge 411fc91 into ebaff4e
Browse files Browse the repository at this point in the history
  • Loading branch information
bsacharski committed Oct 2, 2020
2 parents ebaff4e + 411fc91 commit 9ab6db1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,9 @@
- Symfony 5 recipe.
- Command for checking if a deploy is unlocked. [#2150] [#2150]

### Changed
- Make deploy:check_remote command less vague in its output. [#2160]

### Fixed
- Normalize CRLF to LF new line endings. [#2111]
- Recipe for Magento now supports locale configuration for `setup:static-content:deploy`. [#2040]
Expand Down Expand Up @@ -586,6 +589,7 @@

[#2170]: https://github.com/deployphp/deployer/issues/2170
[#2165]: https://github.com/deployphp/deployer/issues/2165
[#2160]: https://github.com/deployphp/deployer/issues/2160
[#2150]: https://github.com/deployphp/deployer/issues/2150
[#2111]: https://github.com/deployphp/deployer/pull/2111
[#2052]: https://github.com/deployphp/deployer/issues/2052
Expand Down
8 changes: 7 additions & 1 deletion recipe/deploy/check_remote.php
Expand Up @@ -3,6 +3,7 @@

use Deployer\Exception\Exception;
use Deployer\Exception\GracefulShutdownException;
use Deployer\Task\Context;

// Cancel deployment if there would be no change to the codebase.
// This avoids unnecessary releases if the latest commit has already been deployed.
Expand Down Expand Up @@ -53,6 +54,11 @@
$targetRevision = trim($targetRevision);
$lastDeployedRevision = trim(run(sprintf('cd {{deploy_path}}/current && %s rev-parse HEAD', get('bin/git'))));
if ($targetRevision && strpos($lastDeployedRevision, $targetRevision) === 0) {
throw new GracefulShutdownException("Already up-to-date.");
$targetHost = Context::get()->getHost();

$hostname = $targetHost->getHostname();
$realHostname = $targetHost->getRealHostname();

throw new GracefulShutdownException("$hostname ($realHostname) is already up-to-date.");
}
});

0 comments on commit 9ab6db1

Please sign in to comment.