@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | new InputOption('plan', null, InputOption::VALUE_NONE, 'Show execution plan'), |
21 | 21 | new InputOption('start-from', null, InputOption::VALUE_REQUIRED, 'Start execution from this task'), |
22 | 22 | new InputOption('log', null, InputOption::VALUE_REQUIRED, 'Write log to a file'), |
23 | - new InputOption('profile', null, InputOption::VALUE_REQUIRED, 'Write profile to a file', ), |
|
24 | - new InputOption('ansi', null, InputOption::VALUE_OPTIONAL, 'Force ANSI output', ), |
|
23 | + new InputOption('profile', null, InputOption::VALUE_REQUIRED, 'Write profile to a file',), |
|
24 | + new InputOption('ansi', null, InputOption::VALUE_OPTIONAL, 'Force ANSI output',), |
|
25 | 25 | ]); |
26 | 26 | |
27 | 27 | $args = IOArguments::collect( |
@@ -29,6 +29,6 @@ discard block |
||
29 | 29 | new ConsoleOutput(OutputInterface::VERBOSITY_DEBUG, false), |
30 | 30 | ); |
31 | 31 | |
32 | - self::assertEquals(['--option','env=prod', '--limit', '1', '-vvv'], $args); |
|
32 | + self::assertEquals(['--option', 'env=prod', '--limit', '1', '-vvv'], $args); |
|
33 | 33 | } |
34 | 34 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | private function generateCommand(array $arguments): array |
37 | 37 | { |
38 | - $arguments = array_merge([ $this->binaryPath ], $arguments); |
|
38 | + $arguments = array_merge([$this->binaryPath], $arguments); |
|
39 | 39 | |
40 | 40 | $outputArgs = []; |
41 | 41 | foreach ($arguments as $key => $value) { |
@@ -10,7 +10,7 @@ |
||
10 | 10 | set('repository', 'https://github.com/deployphp/test-laravel.git'); |
11 | 11 | set('branch', 'main'); |
12 | 12 | |
13 | -task('laravel:setup-env', function (): void { |
|
13 | +task('laravel:setup-env', function(): void { |
|
14 | 14 | $sharedPath = "{{deploy_path}}/shared"; |
15 | 15 | $envFile = "$sharedPath/.env"; |
16 | 16 |
@@ -8,9 +8,9 @@ |
||
8 | 8 | |
9 | 9 | require_once __DIR__ . '/hosts.php'; |
10 | 10 | |
11 | -task('test:timeouts', function () { |
|
11 | +task('test:timeouts', function() { |
|
12 | 12 | try { |
13 | - run("php -r 'while(true){}'", [ 'timeout' => 1 ]); |
|
13 | + run("php -r 'while(true){}'", ['timeout' => 1]); |
|
14 | 14 | } catch (TimeoutException $e) { |
15 | 15 | $ps = run("if ps aux | grep '[p]hp -r while(true){}'; then echo still running; else echo +timeout; fi"); |
16 | 16 | if ($ps != '+timeout') { |
@@ -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'); |
@@ -51,22 +51,22 @@ discard block |
||
51 | 51 | use Deployer\Task\Context; |
52 | 52 | use Deployer\Utility\Httpie; |
53 | 53 | |
54 | -set('discord_webhook', function () { |
|
54 | +set('discord_webhook', function() { |
|
55 | 55 | return 'https://discordapp.com/api/webhooks/{{discord_channel}}/{{discord_token}}/slack'; |
56 | 56 | }); |
57 | 57 | |
58 | 58 | // Deploy messages |
59 | -set('discord_notify_text', function () { |
|
59 | +set('discord_notify_text', function() { |
|
60 | 60 | return [ |
61 | 61 | 'text' => parse(':information_source: **{{user}}** is deploying branch `{{branch}}` to _{{target}}_'), |
62 | 62 | ]; |
63 | 63 | }); |
64 | -set('discord_success_text', function () { |
|
64 | +set('discord_success_text', function() { |
|
65 | 65 | return [ |
66 | 66 | 'text' => parse(':white_check_mark: Branch `{{branch}}` deployed to _{{target}}_ successfully'), |
67 | 67 | ]; |
68 | 68 | }); |
69 | -set('discord_failure_text', function () { |
|
69 | +set('discord_failure_text', function() { |
|
70 | 70 | return [ |
71 | 71 | 'text' => parse(':no_entry_sign: Branch `{{branch}}` has failed to deploy to _{{target}}_'), |
72 | 72 | ]; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | set('discord_message', 'discord_notify_text'); |
77 | 77 | |
78 | 78 | // Helpers |
79 | -task('discord_send_message', function () { |
|
79 | +task('discord_send_message', function() { |
|
80 | 80 | $message = get(get('discord_message')); |
81 | 81 | |
82 | 82 | Httpie::post(get('discord_webhook'))->jsonBody($message)->send(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | // Tasks |
86 | 86 | desc('Tests messages'); |
87 | -task('discord:test', function () { |
|
87 | +task('discord:test', function() { |
|
88 | 88 | set('discord_message', 'discord_notify_text'); |
89 | 89 | invoke('discord_send_message'); |
90 | 90 | set('discord_message', 'discord_success_text'); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ->once(); |
96 | 96 | |
97 | 97 | desc('Notifies Discord'); |
98 | -task('discord:notify', function () { |
|
98 | +task('discord:notify', function() { |
|
99 | 99 | set('discord_message', 'discord_notify_text'); |
100 | 100 | invoke('discord_send_message'); |
101 | 101 | }) |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | ->isHidden(); |
104 | 104 | |
105 | 105 | desc('Notifies Discord about deploy finish'); |
106 | -task('discord:notify:success', function () { |
|
106 | +task('discord:notify:success', function() { |
|
107 | 107 | set('discord_message', 'discord_success_text'); |
108 | 108 | invoke('discord_send_message'); |
109 | 109 | }) |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | ->isHidden(); |
112 | 112 | |
113 | 113 | desc('Notifies Discord about deploy failure'); |
114 | -task('discord:notify:failure', function () { |
|
114 | +task('discord:notify:failure', function() { |
|
115 | 115 | set('discord_message', 'discord_failure_text'); |
116 | 116 | invoke('discord_send_message'); |
117 | 117 | }) |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | set('mattermost_failure_text', 'Deploy to **{{target}}** failed {{mattermost_failure_emoji}}'); |
92 | 92 | |
93 | 93 | desc('Notifies mattermost'); |
94 | -task('mattermost:notify', function () { |
|
94 | +task('mattermost:notify', function() { |
|
95 | 95 | if (null === get('mattermost_webhook')) { |
96 | 96 | return; |
97 | 97 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | }); |
113 | 113 | |
114 | 114 | desc('Notifies mattermost about deploy finish'); |
115 | -task('mattermost:notify:success', function () { |
|
115 | +task('mattermost:notify:success', function() { |
|
116 | 116 | if (null === get('mattermost_webhook')) { |
117 | 117 | return; |
118 | 118 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | }); |
134 | 134 | |
135 | 135 | desc('Notifies mattermost about deploy failure'); |
136 | -task('mattermost:notify:failure', function () { |
|
136 | +task('mattermost:notify:failure', function() { |
|
137 | 137 | if (null === get('mattermost_webhook')) { |
138 | 138 | return; |
139 | 139 | } |