Skip to content

Commit

Permalink
Merge branch 'master' of github.com:deployphp/deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
oanhnn committed May 19, 2016
2 parents 48a8be9 + a352114 commit 0b40e8b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions recipe/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@
}
return version_compare($version, '2.3', '>=');
});
env('release_name', date('YmdHis')); // name of folder in releases
env('release_name', function () {
// Set the deployment timezone
if (!date_default_timezone_set(env('timezone'))) {
date_default_timezone_set('UTC');
}

return date('YmdHis');
}); // name of folder in releases

/**
* Custom bins.
Expand Down Expand Up @@ -119,11 +126,6 @@
throw $e;
}

// Set the deployment timezone
if (!date_default_timezone_set(env('timezone'))) {
date_default_timezone_set('UTC');
}

run('if [ ! -d {{deploy_path}} ]; then mkdir -p {{deploy_path}}; fi');

// Check for existing /current directory (not symlink)
Expand All @@ -150,10 +152,10 @@
* Release
*/
task('deploy:release', function () {
$releasePath = "{{deploy_path}}/releases/{{release_name}}";
$releasePath = env()->parse("{{deploy_path}}/releases/{{release_name}}");

$i = 0;
while (is_dir(env()->parse($releasePath)) && $i < 42) {
while (run("if [ -d $releasePath ]; then echo 'true'; fi")->toBool()) {
$releasePath .= '.' . ++$i;
}

Expand Down

0 comments on commit 0b40e8b

Please sign in to comment.