@@ -8,7 +8,7 @@ |
||
| 8 | 8 | namespace Deployer; |
| 9 | 9 | |
| 10 | 10 | desc('Cleaning up old releases'); |
| 11 | -task('deploy:cleanup', function () { |
|
| 11 | +task('deploy:cleanup', function() { |
|
| 12 | 12 | $releases = get('releases_list'); |
| 13 | 13 | $keep = get('keep_releases'); |
| 14 | 14 | $runOpts = []; |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | namespace Deployer; |
| 9 | 9 | |
| 10 | -task('deploy:info', function () { |
|
| 10 | +task('deploy:info', function() { |
|
| 11 | 11 | $what = ''; |
| 12 | 12 | $branch = get('branch'); |
| 13 | 13 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | namespace Deployer; |
| 9 | 9 | |
| 10 | 10 | desc('Creating symlink to release'); |
| 11 | -task('deploy:symlink', function () { |
|
| 11 | +task('deploy:symlink', function() { |
|
| 12 | 12 | if (get('use_atomic_symlink')) { |
| 13 | 13 | run("mv -T {{deploy_path}}/release {{deploy_path}}/current"); |
| 14 | 14 | } else { |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | use Deployer\Exception\Exception; |
| 11 | 11 | |
| 12 | 12 | desc('Rollback to previous release'); |
| 13 | -task('rollback', function () { |
|
| 13 | +task('rollback', function() { |
|
| 14 | 14 | $releases = get('releases_list'); |
| 15 | 15 | |
| 16 | 16 | if (isset($releases[1])) { |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | namespace Deployer; |
| 9 | 9 | |
| 10 | 10 | desc('Installing vendors'); |
| 11 | -task('deploy:vendors', function () { |
|
| 11 | +task('deploy:vendors', function() { |
|
| 12 | 12 | if (!commandExist('unzip')) { |
| 13 | 13 | warning('To speed up composer installation setup "unzip" command with PHP zip extension.'); |
| 14 | 14 | } |
@@ -13,14 +13,14 @@ |
||
| 13 | 13 | // Cancel deployment if there would be no change to the codebase. |
| 14 | 14 | // This avoids unnecessary releases if the latest commit has already been deployed. |
| 15 | 15 | desc('Check remote head'); |
| 16 | -task('deploy:check_remote', function () { |
|
| 16 | +task('deploy:check_remote', function() { |
|
| 17 | 17 | $repository = get('repository'); |
| 18 | 18 | if (empty($repository)) { |
| 19 | 19 | throw new Exception("You need to specify a repository."); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | // Skip if there is no current deployment to compare |
| 23 | - if (! test('[ -d {{deploy_path}}/current/.git ]')) { |
|
| 23 | + if (!test('[ -d {{deploy_path}}/current/.git ]')) { |
|
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | use function Deployer\Support\str_contains; |
| 12 | 12 | |
| 13 | 13 | desc('Preparing host for deploy'); |
| 14 | -task('deploy:setup', function () { |
|
| 14 | +task('deploy:setup', function() { |
|
| 15 | 15 | // Check if shell is POSIX-compliant |
| 16 | 16 | $result = run('echo $0'); |
| 17 | 17 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | use Deployer\Exception\RunException; |
| 12 | 12 | |
| 13 | 13 | desc('Lock deploy'); |
| 14 | -task('deploy:lock', function () { |
|
| 14 | +task('deploy:lock', function() { |
|
| 15 | 15 | $locked = test("[ -f {{deploy_path}}/.dep/deploy.lock ]"); |
| 16 | 16 | |
| 17 | 17 | if ($locked) { |
@@ -25,19 +25,19 @@ discard block |
||
| 25 | 25 | }); |
| 26 | 26 | |
| 27 | 27 | desc('Unlock deploy'); |
| 28 | -task('deploy:unlock', function () { |
|
| 29 | - run("rm -f {{deploy_path}}/.dep/deploy.lock");//always success |
|
| 28 | +task('deploy:unlock', function() { |
|
| 29 | + run("rm -f {{deploy_path}}/.dep/deploy.lock"); //always success |
|
| 30 | 30 | }); |
| 31 | 31 | |
| 32 | 32 | desc('Check if deploy is unlocked'); |
| 33 | -task('deploy:is-unlocked', function () { |
|
| 33 | +task('deploy:is-unlocked', function() { |
|
| 34 | 34 | $locked = test("[ -f {{deploy_path}}/.dep/deploy.lock ]"); |
| 35 | 35 | |
| 36 | 36 | if ($locked) { |
| 37 | - writeln( 'Deploy is currently locked.'); |
|
| 37 | + writeln('Deploy is currently locked.'); |
|
| 38 | 38 | |
| 39 | 39 | throw new GracefulShutdownException(); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - writeln( 'Deploy is currently unlocked.'); |
|
| 42 | + writeln('Deploy is currently unlocked.'); |
|
| 43 | 43 | }); |
@@ -13,26 +13,26 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * Name of folder in releases. |
| 15 | 15 | */ |
| 16 | -set('release_name', function () { |
|
| 16 | +set('release_name', function() { |
|
| 17 | 17 | $list = get('releases_list'); |
| 18 | 18 | |
| 19 | 19 | // Filter out anything that does not look like a release. |
| 20 | - $list = array_filter($list, function ($release) { |
|
| 20 | + $list = array_filter($list, function($release) { |
|
| 21 | 21 | return preg_match('/^[\d\.]+$/', $release); |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | 24 | $nextReleaseNumber = 1; |
| 25 | 25 | if (count($list) > 0) { |
| 26 | - $nextReleaseNumber = (int)max($list) + 1; |
|
| 26 | + $nextReleaseNumber = (int) max($list) + 1; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - return (string)$nextReleaseNumber; |
|
| 29 | + return (string) $nextReleaseNumber; |
|
| 30 | 30 | }); |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Return list of releases on host. |
| 34 | 34 | */ |
| 35 | -set('releases_list', function () { |
|
| 35 | +set('releases_list', function() { |
|
| 36 | 36 | cd('{{deploy_path}}'); |
| 37 | 37 | |
| 38 | 38 | // If there is no releases return empty list. |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $list = explode("\n", run('cd releases && ls -t -1 -d */')); |
| 45 | 45 | |
| 46 | 46 | // Prepare list. |
| 47 | - $list = array_map(function ($release) { |
|
| 47 | + $list = array_map(function($release) { |
|
| 48 | 48 | return basename(rtrim(trim($release), '/')); |
| 49 | 49 | }, $list); |
| 50 | 50 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * Return release path. |
| 89 | 89 | */ |
| 90 | -set('release_path', function () { |
|
| 90 | +set('release_path', function() { |
|
| 91 | 91 | $releaseExists = test('[ -h {{deploy_path}}/release ]'); |
| 92 | 92 | if ($releaseExists) { |
| 93 | 93 | $link = run("readlink {{deploy_path}}/release"); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | desc('Prepare release. Clean up unfinished releases and prepare next release'); |
| 102 | -task('deploy:release', function () { |
|
| 102 | +task('deploy:release', function() { |
|
| 103 | 103 | cd('{{deploy_path}}'); |
| 104 | 104 | |
| 105 | 105 | // Clean up if there is unfinished release |