@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | ]); |
| 28 | 28 | |
| 29 | 29 | // Mock vendors installation to speed up tests. |
| 30 | -task('deploy:vendors', function () { |
|
| 30 | +task('deploy:vendors', function() { |
|
| 31 | 31 | if (!commandExist('unzip')) { |
| 32 | 32 | warning('To speed up composer installation setup "unzip" command with PHP zip extension.'); |
| 33 | 33 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | 'deploy:publish', |
| 41 | 41 | ]); |
| 42 | 42 | |
| 43 | -task('fail', function () { |
|
| 43 | +task('fail', function() { |
|
| 44 | 44 | run('false'); |
| 45 | 45 | }); |
| 46 | 46 | |
@@ -4,13 +4,13 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | localhost('prod'); |
| 6 | 6 | localhost('beta') |
| 7 | - ->set('host_level_callback_config', function () { |
|
| 7 | + ->set('host_level_callback_config', function() { |
|
| 8 | 8 | return 'from callback'; |
| 9 | 9 | }); |
| 10 | 10 | |
| 11 | 11 | // testServer: |
| 12 | 12 | |
| 13 | -task('ask', function () { |
|
| 13 | +task('ask', function() { |
|
| 14 | 14 | $answer = ask('Question: What kind of bear is best?'); |
| 15 | 15 | writeln($answer); |
| 16 | 16 | }); |
@@ -19,23 +19,23 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | set('greet', '_'); |
| 21 | 21 | |
| 22 | -task('echo', function () { |
|
| 22 | +task('echo', function() { |
|
| 23 | 23 | $alias = currentHost()->getAlias(); |
| 24 | 24 | run("echo {{greet}}, $alias!"); |
| 25 | 25 | }); |
| 26 | 26 | |
| 27 | 27 | // testCachedHostConfig: |
| 28 | 28 | |
| 29 | -set('upper_host', function () { |
|
| 29 | +set('upper_host', function() { |
|
| 30 | 30 | writeln('running ' . (Deployer::isWorker() ? 'worker' : 'master') . ' on ' . currentHost()->getAlias()); |
| 31 | 31 | return strtoupper(currentHost()->getAlias()); |
| 32 | 32 | }); |
| 33 | 33 | |
| 34 | -task('cache_config_test', function () { |
|
| 34 | +task('cache_config_test', function() { |
|
| 35 | 35 | writeln('echo 1: {{upper_host}}'); |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | -after('cache_config_test', function () { |
|
| 38 | +after('cache_config_test', function() { |
|
| 39 | 39 | writeln('echo 2: {{upper_host}}'); |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -43,6 +43,6 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | set('host_level_callback_config', 'from global'); |
| 45 | 45 | |
| 46 | -task('host_config_from_callback', function () { |
|
| 46 | +task('host_config_from_callback', function() { |
|
| 47 | 47 | writeln('config value is {{host_level_callback_config}}'); |
| 48 | 48 | }); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | set('rsync_src', __DIR__); |
| 137 | 137 | set('rsync_dest', '{{release_path}}'); |
| 138 | 138 | |
| 139 | -set('rsync_excludes', function () { |
|
| 139 | +set('rsync_excludes', function() { |
|
| 140 | 140 | $config = get('rsync'); |
| 141 | 141 | $excludes = $config['exclude']; |
| 142 | 142 | $excludeFile = $config['exclude-file']; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | return $excludesRsync; |
| 152 | 152 | }); |
| 153 | 153 | |
| 154 | -set('rsync_includes', function () { |
|
| 154 | +set('rsync_includes', function() { |
|
| 155 | 155 | $config = get('rsync'); |
| 156 | 156 | $includes = $config['include']; |
| 157 | 157 | $includeFile = $config['include-file']; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | return $includesRsync; |
| 167 | 167 | }); |
| 168 | 168 | |
| 169 | -set('rsync_filter', function () { |
|
| 169 | +set('rsync_filter', function() { |
|
| 170 | 170 | $config = get('rsync'); |
| 171 | 171 | $filters = $config['filter']; |
| 172 | 172 | $filterFile = $config['filter-file']; |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | return $filtersRsync; |
| 185 | 185 | }); |
| 186 | 186 | |
| 187 | -set('rsync_options', function () { |
|
| 187 | +set('rsync_options', function() { |
|
| 188 | 188 | $config = get('rsync'); |
| 189 | 189 | $options = $config['options']; |
| 190 | 190 | $optionsRsync = []; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | desc('Warmups remote Rsync target'); |
| 199 | -task('rsync:warmup', function () { |
|
| 199 | +task('rsync:warmup', function() { |
|
| 200 | 200 | $config = get('rsync'); |
| 201 | 201 | |
| 202 | 202 | $source = "{{current_path}}"; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | desc('Rsync local->remote'); |
| 214 | -task('rsync', function () { |
|
| 214 | +task('rsync', function() { |
|
| 215 | 215 | $config = get('rsync'); |
| 216 | 216 | |
| 217 | 217 | $src = get('rsync_src'); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | return $stopResponseInfo['http_code'] === 200; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | -task('supervisord-monitor:restart', function () { |
|
| 134 | +task('supervisord-monitor:restart', function() { |
|
| 135 | 135 | if (supervisordIsAuthenticated()) { |
| 136 | 136 | $names = explode(',', get('supervisord_process_name')); |
| 137 | 137 | foreach ($names as $name) { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | }); |
| 150 | 150 | |
| 151 | -task('supervisord-monitor:stop', function () { |
|
| 151 | +task('supervisord-monitor:stop', function() { |
|
| 152 | 152 | if (supervisordIsAuthenticated()) { |
| 153 | 153 | $names = explode(',', get('supervisord_process_name')); |
| 154 | 154 | foreach ($names as $name) { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | }); |
| 164 | 164 | |
| 165 | -task('supervisord-monitor:start', function () { |
|
| 165 | +task('supervisord-monitor:start', function() { |
|
| 166 | 166 | if (supervisordIsAuthenticated()) { |
| 167 | 167 | $names = explode(',', get('supervisord_process_name')); |
| 168 | 168 | foreach ($names as $name) { |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | use PhpAmqpLib\Message\AMQPMessage; |
| 56 | 56 | |
| 57 | 57 | desc('Notifies RabbitMQ channel about deployment'); |
| 58 | -task('deploy:rabbit', function () { |
|
| 58 | +task('deploy:rabbit', function() { |
|
| 59 | 59 | |
| 60 | 60 | if (!class_exists('PhpAmqpLib\Connection\AMQPConnection')) { |
| 61 | 61 | throw new \RuntimeException("<comment>Please install php package</comment> <info>videlalvaro/php-amqplib</info> <comment>to use rabbitmq</comment>"); |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $httpie->send(); |
| 144 | 144 | }) |
| 145 | - ->once() |
|
| 146 | - ->hidden(); |
|
| 145 | + ->once() |
|
| 146 | + ->hidden(); |
|
| 147 | 147 | |
| 148 | 148 | desc('Notifies Telegram about deploy failure'); |
| 149 | 149 | task('telegram:notify:failure', function () { |
@@ -173,5 +173,5 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | $httpie->send(); |
| 175 | 175 | }) |
| 176 | - ->once() |
|
| 177 | - ->hidden(); |
|
| 176 | + ->once() |
|
| 177 | + ->hidden(); |
|
@@ -62,18 +62,18 @@ discard block |
||
| 62 | 62 | use Deployer\Utility\Httpie; |
| 63 | 63 | |
| 64 | 64 | // Title of project |
| 65 | -set('telegram_title', function () { |
|
| 65 | +set('telegram_title', function() { |
|
| 66 | 66 | return get('application', 'Project'); |
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | 69 | // Telegram settings |
| 70 | -set('telegram_token', function () { |
|
| 70 | +set('telegram_token', function() { |
|
| 71 | 71 | throw new \Exception('Please, configure "telegram_token" parameter.'); |
| 72 | 72 | }); |
| 73 | -set('telegram_chat_id', function () { |
|
| 73 | +set('telegram_chat_id', function() { |
|
| 74 | 74 | throw new \Exception('Please, configure "telegram_chat_id" parameter.'); |
| 75 | 75 | }); |
| 76 | -set('telegram_url', function () { |
|
| 76 | +set('telegram_url', function() { |
|
| 77 | 77 | return 'https://api.telegram.org/bot' . get('telegram_token') . '/sendmessage'; |
| 78 | 78 | }); |
| 79 | 79 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | desc('Notifies Telegram'); |
| 87 | -task('telegram:notify', function () { |
|
| 87 | +task('telegram:notify', function() { |
|
| 88 | 88 | if (!get('telegram_token', false)) { |
| 89 | 89 | warning('No Telegram token configured'); |
| 90 | 90 | return; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | ->hidden(); |
| 116 | 116 | |
| 117 | 117 | desc('Notifies Telegram about deploy finish'); |
| 118 | -task('telegram:notify:success', function () { |
|
| 118 | +task('telegram:notify:success', function() { |
|
| 119 | 119 | if (!get('telegram_token', false)) { |
| 120 | 120 | warning('No Telegram token configured'); |
| 121 | 121 | return; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | ->hidden(); |
| 147 | 147 | |
| 148 | 148 | desc('Notifies Telegram about deploy failure'); |
| 149 | -task('telegram:notify:failure', function () { |
|
| 149 | +task('telegram:notify:failure', function() { |
|
| 150 | 150 | if (!get('telegram_token', false)) { |
| 151 | 151 | warning('No Telegram token configured'); |
| 152 | 152 | return; |
@@ -13,13 +13,13 @@ |
||
| 13 | 13 | |
| 14 | 14 | namespace Deployer; |
| 15 | 15 | |
| 16 | -set('bin/yarn', function () { |
|
| 16 | +set('bin/yarn', function() { |
|
| 17 | 17 | return which('yarn'); |
| 18 | 18 | }); |
| 19 | 19 | |
| 20 | 20 | // In there is a {{previous_release}}, node_modules will be copied from it before installing deps with yarn. |
| 21 | 21 | desc('Installs Yarn packages'); |
| 22 | -task('yarn:install', function () { |
|
| 22 | +task('yarn:install', function() { |
|
| 23 | 23 | if (has('previous_release')) { |
| 24 | 24 | if (test('[ -d {{previous_release}}/node_modules ]')) { |
| 25 | 25 | run('cp -R {{previous_release}}/node_modules {{release_path}}'); |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | use Deployer\Utility\Httpie; |
| 62 | 62 | |
| 63 | 63 | // Title of project based on git repo |
| 64 | -set('cimonitor_title', function () { |
|
| 64 | +set('cimonitor_title', function() { |
|
| 65 | 65 | $repo = get('repository'); |
| 66 | 66 | $pattern = '/\w+\/\w+/'; |
| 67 | 67 | return preg_match($pattern, $repo, $titles) ? $titles[0] : $repo; |
| 68 | 68 | }); |
| 69 | -set('cimonitor_user', function () { |
|
| 69 | +set('cimonitor_user', function() { |
|
| 70 | 70 | return [ |
| 71 | 71 | 'name' => runLocally('git config --get user.name'), |
| 72 | 72 | 'email' => runLocally('git config --get user.email'), |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | set('cimonitor_job_state_success', get('cimonitor_status_success')); |
| 87 | 87 | |
| 88 | 88 | desc('Notifies CIMonitor'); |
| 89 | -task('cimonitor:notify', function () { |
|
| 89 | +task('cimonitor:notify', function() { |
|
| 90 | 90 | if (!get('cimonitor_webhook', false)) { |
| 91 | 91 | return; |
| 92 | 92 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | ->hidden(); |
| 113 | 113 | |
| 114 | 114 | desc('Notifies CIMonitor about deploy finish'); |
| 115 | -task('cimonitor:notify:success', function () { |
|
| 115 | +task('cimonitor:notify:success', function() { |
|
| 116 | 116 | if (!get('cimonitor_webhook', false)) { |
| 117 | 117 | return; |
| 118 | 118 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | ->hidden(); |
| 141 | 141 | |
| 142 | 142 | desc('Notifies CIMonitor about deploy failure'); |
| 143 | -task('cimonitor:notify:failure', function () { |
|
| 143 | +task('cimonitor:notify:failure', function() { |
|
| 144 | 144 | if (!get('cimonitor_webhook', false)) { |
| 145 | 145 | return; |
| 146 | 146 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | desc('Creates database though CPanel API'); |
| 196 | -task('cpanel:createdb', function () { |
|
| 196 | +task('cpanel:createdb', function() { |
|
| 197 | 197 | |
| 198 | 198 | $cpanel = getCPanel(); |
| 199 | 199 | $config = get('cpanel', []); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | }); |
| 222 | 222 | |
| 223 | 223 | desc('Creates addon domain though CPanel API'); |
| 224 | -task('cpanel:createaddondomain', function () { |
|
| 224 | +task('cpanel:createaddondomain', function() { |
|
| 225 | 225 | $cpanel = getCPanel(); |
| 226 | 226 | $config = get('cpanel', []); |
| 227 | 227 | $domain = getDomainInfo()['domain']; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | }); |
| 245 | 245 | |
| 246 | 246 | desc('Deletes addon domain though CPanel API'); |
| 247 | -task('cpanel:deleteaddondomain', function () { |
|
| 247 | +task('cpanel:deleteaddondomain', function() { |
|
| 248 | 248 | $cpanel = getCPanel(); |
| 249 | 249 | $config = get('cpanel', []); |
| 250 | 250 | $domain = getDomainInfo()['domain']; |