@@ -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']; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | desc('Notifies Sentry of deployment'); |
66 | 66 | task( |
67 | 67 | 'deploy:sentry', |
68 | - static function () { |
|
68 | + static function() { |
|
69 | 69 | $now = date('c'); |
70 | 70 | |
71 | 71 | $defaultConfig = [ |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $config = array_merge($defaultConfig, (array) get('sentry')); |
88 | 88 | array_walk( |
89 | 89 | $config, |
90 | - static function (&$value) use ($config) { |
|
90 | + static function(&$value) use ($config) { |
|
91 | 91 | if (is_callable($value)) { |
92 | 92 | $value = $value($config); |
93 | 93 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | function getReleaseGitRef(): Closure |
224 | 224 | { |
225 | - return static function ($config = []): string { |
|
225 | + return static function($config = []): string { |
|
226 | 226 | if (get('update_code_strategy') === 'archive') { |
227 | 227 | if (isset($config['git_version_command'])) { |
228 | 228 | cd('{{deploy_path}}/.dep/repo'); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | function getGitCommitsRefs(): Closure |
247 | 247 | { |
248 | - return static function ($config = []): array { |
|
248 | + return static function($config = []): array { |
|
249 | 249 | $previousReleaseRevision = getPreviousReleaseRevision(); |
250 | 250 | $currentReleaseRevision = getCurrentReleaseRevision() ?: 'HEAD'; |
251 | 251 | |
@@ -266,13 +266,13 @@ discard block |
||
266 | 266 | $lines = array_filter( |
267 | 267 | // limit number of commits for first release with many commits |
268 | 268 | array_map('trim', array_slice(explode("\n", $result), 0, 200)), |
269 | - static function (string $line): bool { |
|
269 | + static function(string $line): bool { |
|
270 | 270 | return !empty($line) && strpos($line, 'commit') !== 0; |
271 | 271 | }, |
272 | 272 | ); |
273 | 273 | |
274 | 274 | return array_map( |
275 | - static function (string $line): array { |
|
275 | + static function(string $line): array { |
|
276 | 276 | [$ref, $authorName, $authorEmail, $timestamp, $message] = explode('#', $line, 5); |
277 | 277 | |
278 | 278 | return [ |
@@ -35,7 +35,7 @@ |
||
35 | 35 | use Deployer\Utility\Httpie; |
36 | 36 | |
37 | 37 | desc('Creates Grafana annotation of deployment'); |
38 | -task('grafana:annotation', function () { |
|
38 | +task('grafana:annotation', function() { |
|
39 | 39 | $defaultConfig = [ |
40 | 40 | 'url' => null, |
41 | 41 | 'token' => null, |