@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | use Deployer\Utility\Httpie; |
11 | 11 | |
12 | -set('newrelic_app_id', function () { |
|
12 | +set('newrelic_app_id', function() { |
|
13 | 13 | throw new \Exception('Please, configure "newrelic_app_id" parameter.'); |
14 | 14 | }); |
15 | 15 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | }); |
23 | 23 | |
24 | 24 | desc('Notifying New Relic of deployment'); |
25 | -task('newrelic:notify', function () { |
|
25 | +task('newrelic:notify', function() { |
|
26 | 26 | if (($appId = get('newrelic_app_id')) && ($apiKey = get('newrelic_api_key'))) { |
27 | 27 | $data = [ |
28 | 28 | 'user' => get('user'), |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | set('rsync_src', __DIR__); |
29 | 29 | set('rsync_dest', '{{release_path}}'); |
30 | 30 | |
31 | -set('rsync_excludes', function () { |
|
31 | +set('rsync_excludes', function() { |
|
32 | 32 | $config = get('rsync'); |
33 | 33 | $excludes = $config['exclude']; |
34 | 34 | $excludeFile = $config['exclude-file']; |
35 | 35 | $excludesRsync = ''; |
36 | 36 | foreach ($excludes as $exclude) { |
37 | - $excludesRsync.=' --exclude=' . escapeshellarg($exclude); |
|
37 | + $excludesRsync .= ' --exclude=' . escapeshellarg($exclude); |
|
38 | 38 | } |
39 | 39 | if (!empty($excludeFile) && file_exists($excludeFile) && is_file($excludeFile) && is_readable($excludeFile)) { |
40 | 40 | $excludesRsync .= ' --exclude-from=' . escapeshellarg($excludeFile); |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | return $excludesRsync; |
44 | 44 | }); |
45 | 45 | |
46 | -set('rsync_includes', function () { |
|
46 | +set('rsync_includes', function() { |
|
47 | 47 | $config = get('rsync'); |
48 | 48 | $includes = $config['include']; |
49 | 49 | $includeFile = $config['include-file']; |
50 | 50 | $includesRsync = ''; |
51 | 51 | foreach ($includes as $include) { |
52 | - $includesRsync.=' --include=' . escapeshellarg($include); |
|
52 | + $includesRsync .= ' --include=' . escapeshellarg($include); |
|
53 | 53 | } |
54 | 54 | if (!empty($includeFile) && file_exists($includeFile) && is_file($includeFile) && is_readable($includeFile)) { |
55 | 55 | $includesRsync .= ' --include-from=' . escapeshellarg($includeFile); |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | return $includesRsync; |
59 | 59 | }); |
60 | 60 | |
61 | -set('rsync_filter', function () { |
|
61 | +set('rsync_filter', function() { |
|
62 | 62 | $config = get('rsync'); |
63 | 63 | $filters = $config['filter']; |
64 | 64 | $filterFile = $config['filter-file']; |
65 | 65 | $filterPerDir = $config['filter-perdir']; |
66 | 66 | $filtersRsync = ''; |
67 | 67 | foreach ($filters as $filter) { |
68 | - $filtersRsync.=" --filter='$filter'"; |
|
68 | + $filtersRsync .= " --filter='$filter'"; |
|
69 | 69 | } |
70 | 70 | if (!empty($filterFile)) { |
71 | 71 | $filtersRsync .= " --filter='merge $filterFile'"; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | return $filtersRsync; |
77 | 77 | }); |
78 | 78 | |
79 | -set('rsync_options', function () { |
|
79 | +set('rsync_options', function() { |
|
80 | 80 | $config = get('rsync'); |
81 | 81 | $options = $config['options']; |
82 | 82 | $optionsRsync = []; |
@@ -10,7 +10,7 @@ |
||
10 | 10 | use Deployer\Utility\Httpie; |
11 | 11 | |
12 | 12 | desc('Notifying Bugsnag of deployment'); |
13 | -task('bugsnag:notify', function () { |
|
13 | +task('bugsnag:notify', function() { |
|
14 | 14 | $data = [ |
15 | 15 | 'apiKey' => get('bugsnag_api_key'), |
16 | 16 | 'releaseStage' => get('target'), |
@@ -15,7 +15,7 @@ |
||
15 | 15 | set('hipchat_url', 'https://api.hipchat.com/v1/rooms/message'); |
16 | 16 | |
17 | 17 | desc('Notifying Hipchat channel of deployment'); |
18 | -task('hipchat:notify', function () { |
|
18 | +task('hipchat:notify', function() { |
|
19 | 19 | $params = [ |
20 | 20 | 'room_id' => get('hipchat_room_id'), |
21 | 21 | 'from' => get('target'), |
@@ -17,8 +17,8 @@ |
||
17 | 17 | }); |
18 | 18 | set('cimonitor_user', function () { |
19 | 19 | return [ |
20 | - 'name' => runLocally('git config --get user.name'), |
|
21 | - 'email' => runLocally('git config --get user.email'), |
|
20 | + 'name' => runLocally('git config --get user.name'), |
|
21 | + 'email' => runLocally('git config --get user.email'), |
|
22 | 22 | ]; |
23 | 23 | }); |
24 | 24 |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | use Deployer\Utility\Httpie; |
11 | 11 | |
12 | 12 | // Title of project based on git repo |
13 | -set('cimonitor_title', function () { |
|
13 | +set('cimonitor_title', function() { |
|
14 | 14 | $repo = get('repository'); |
15 | 15 | $pattern = '/\w+\/\w+/'; |
16 | 16 | return preg_match($pattern, $repo, $titles) ? $titles[0] : $repo; |
17 | 17 | }); |
18 | -set('cimonitor_user', function () { |
|
18 | +set('cimonitor_user', function() { |
|
19 | 19 | return [ |
20 | 20 | 'name' => runLocally('git config --get user.name'), |
21 | 21 | 'email' => runLocally('git config --get user.email'), |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | set('cimonitor_job_state_success', get('cimonitor_status_success')); |
36 | 36 | |
37 | 37 | desc('Notifying CIMonitor'); |
38 | -task('cimonitor:notify', function () { |
|
38 | +task('cimonitor:notify', function() { |
|
39 | 39 | if (!get('cimonitor_webhook', false)) { |
40 | 40 | return; |
41 | 41 | } |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | ->hidden(); |
63 | 63 | |
64 | 64 | desc('Notifying CIMonitor about deploy finish'); |
65 | -task('cimonitor:notify:success', function () { |
|
65 | +task('cimonitor:notify:success', function() { |
|
66 | 66 | if (!get('cimonitor_webhook', false)) { |
67 | 67 | return; |
68 | 68 | } |
69 | 69 | |
70 | - $depstage = 'Deployed to '.get('stage', ''); |
|
70 | + $depstage = 'Deployed to ' . get('stage', ''); |
|
71 | 71 | |
72 | 72 | $body = [ |
73 | 73 | 'state' => get('cimonitor_status_success'), |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ->hidden(); |
92 | 92 | |
93 | 93 | desc('Notifying CIMonitor about deploy failure'); |
94 | -task('cimonitor:notify:failure', function () { |
|
94 | +task('cimonitor:notify:failure', function() { |
|
95 | 95 | if (!get('cimonitor_webhook', false)) { |
96 | 96 | return; |
97 | 97 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | if (!is_array($config) || |
16 | 16 | !isset($config['host']) || |
17 | 17 | !isset($config['username']) || |
18 | - !isset($config['password']) ) { |
|
18 | + !isset($config['password'])) { |
|
19 | 19 | throw new \RuntimeException("Please set the following DirectAdmin config:" . PHP_EOL . "set('directadmin', ['host' => '127.0.0.1', 'port' => 2222, 'username' => 'admin', 'password' => 'password']);"); |
20 | 20 | } |
21 | 21 | |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | desc('Create a database on DirectAdmin'); |
56 | -task('directadmin:createdb', function () { |
|
56 | +task('directadmin:createdb', function() { |
|
57 | 57 | $config = getDirectAdminConfig(); |
58 | 58 | |
59 | 59 | if (!is_array($config) || |
60 | 60 | !isset($config['db_name']) || |
61 | 61 | !isset($config['db_user']) || |
62 | - !isset($config['db_password']) ) { |
|
62 | + !isset($config['db_password'])) { |
|
63 | 63 | throw new \RuntimeException("Please add the following DirectAdmin config:" . PHP_EOL . "add('directadmin', ['db_name' => 'test', 'db_user' => 'test', 'db_password' => '123456']);"); |
64 | 64 | } |
65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | }); |
74 | 74 | |
75 | 75 | desc('Delete a database on DirectAdmin'); |
76 | -task('directadmin:deletedb', function () { |
|
76 | +task('directadmin:deletedb', function() { |
|
77 | 77 | $config = getDirectAdminConfig(); |
78 | 78 | |
79 | 79 | if (!is_array($config) || |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | }); |
89 | 89 | |
90 | 90 | desc('Create a domain on DirectAdmin'); |
91 | -task('directadmin:createdomain', function () { |
|
91 | +task('directadmin:createdomain', function() { |
|
92 | 92 | $config = getDirectAdminConfig(); |
93 | 93 | |
94 | 94 | if (!is_array($config) || |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | }); |
107 | 107 | |
108 | 108 | desc('Delete a domain on DirectAdmin'); |
109 | -task('directadmin:deletedomain', function () { |
|
109 | +task('directadmin:deletedomain', function() { |
|
110 | 110 | $config = getDirectAdminConfig(); |
111 | 111 | |
112 | 112 | if (!is_array($config) || |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | }); |
123 | 123 | |
124 | 124 | desc('Symlink your private_html to public_html'); |
125 | -task('directadmin:symlink-private-html', function () { |
|
125 | +task('directadmin:symlink-private-html', function() { |
|
126 | 126 | $config = getDirectAdminConfig(); |
127 | 127 | |
128 | 128 | if (!is_array($config) || |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | }); |
139 | 139 | |
140 | 140 | desc('Change the PHP version from a domain'); |
141 | -task('directadmin:php-version', function () { |
|
141 | +task('directadmin:php-version', function() { |
|
142 | 142 | $config = getDirectAdminConfig(); |
143 | 143 | |
144 | 144 | if (!is_array($config) || |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use Deployer\Task\Context; |
5 | 5 | use Deployer\Utility\Httpie; |
6 | 6 | |
7 | -set('discord_webhook', function () { |
|
7 | +set('discord_webhook', function() { |
|
8 | 8 | return 'https://discordapp.com/api/webhooks/{{discord_channel}}/{{discord_token}}/slack'; |
9 | 9 | }); |
10 | 10 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | set('discord_message', 'discord_notify_text'); |
30 | 30 | |
31 | 31 | // Helpers |
32 | -task('discord_send_message', function(){ |
|
32 | +task('discord_send_message', function() { |
|
33 | 33 | $message = get(get('discord_message')); |
34 | 34 | |
35 | 35 | Httpie::post(get('discord_webhook'))->body($message)->send(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // Tasks |
39 | 39 | desc('Just notify your Discord channel with all messages, without deploying'); |
40 | -task('discord:test', function () { |
|
40 | +task('discord:test', function() { |
|
41 | 41 | set('discord_message', 'discord_notify_text'); |
42 | 42 | invoke('discord_send_message'); |
43 | 43 | set('discord_message', 'discord_success_text'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ->shallow(); |
50 | 50 | |
51 | 51 | desc('Notify Discord'); |
52 | -task('discord:notify', function () { |
|
52 | +task('discord:notify', function() { |
|
53 | 53 | set('discord_message', 'discord_notify_text'); |
54 | 54 | invoke('discord_send_message'); |
55 | 55 | }) |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | ->isHidden(); |
59 | 59 | |
60 | 60 | desc('Notify Discord about deploy finish'); |
61 | -task('discord:notify:success', function () { |
|
61 | +task('discord:notify:success', function() { |
|
62 | 62 | set('discord_message', 'discord_success_text'); |
63 | 63 | invoke('discord_send_message'); |
64 | 64 | }) |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ->isHidden(); |
68 | 68 | |
69 | 69 | desc('Notify Discord about deploy failure'); |
70 | -task('discord:notify:failure', function () { |
|
70 | +task('discord:notify:failure', function() { |
|
71 | 71 | set('discord_message', 'discord_failure_text'); |
72 | 72 | invoke('discord_send_message'); |
73 | 73 | }) |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | |
10 | 10 | set('cachetool', ''); |
11 | 11 | set('cachetool_args', ''); |
12 | -set('cachetool_binary', function () { |
|
12 | +set('cachetool_binary', function() { |
|
13 | 13 | return run("{{bin/php}} -r \"echo (PHP_VERSION_ID <= 50640) ? 'cachetool-3.2.1.phar' : ((PHP_VERSION_ID <= 70133) ? 'cachetool-4.1.1.phar' : 'cachetool.phar');\""); |
14 | 14 | }); |
15 | -set('bin/cachetool', function () { |
|
15 | +set('bin/cachetool', function() { |
|
16 | 16 | $cachetool_binary = get('cachetool_binary'); |
17 | 17 | $cachetool_binary = locateBinaryPath($cachetool_binary); |
18 | 18 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | return $cachetool_binary; |
25 | 25 | }); |
26 | -set('cachetool_options', function () { |
|
26 | +set('cachetool_options', function() { |
|
27 | 27 | $options = get('cachetool'); |
28 | 28 | $fullOptions = get('cachetool_args'); |
29 | 29 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | }); |
38 | 38 | |
39 | 39 | desc('Clearing APC system cache'); |
40 | -task('cachetool:clear:apc', function () { |
|
40 | +task('cachetool:clear:apc', function() { |
|
41 | 41 | run("cd {{release_path}} && {{bin/php}} {{bin/cachetool}} apc:cache:clear system {{cachetool_options}}"); |
42 | 42 | }); |
43 | 43 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * Clear opcache cache |
46 | 46 | */ |
47 | 47 | desc('Clearing OPcode cache'); |
48 | -task('cachetool:clear:opcache', function () { |
|
48 | +task('cachetool:clear:opcache', function() { |
|
49 | 49 | run("cd {{release_path}} && {{bin/php}} {{bin/cachetool}} opcache:reset {{cachetool_options}}"); |
50 | 50 | }); |
51 | 51 | |
@@ -53,6 +53,6 @@ discard block |
||
53 | 53 | * Clear APCU cache |
54 | 54 | */ |
55 | 55 | desc('Clearing APCu system cache'); |
56 | -task('cachetool:clear:apcu', function () { |
|
56 | +task('cachetool:clear:apcu', function() { |
|
57 | 57 | run("cd {{release_path}} && {{bin/php}} {{bin/cachetool}} apcu:cache:clear {{cachetool_options}}"); |
58 | 58 | }); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | use Deployer\Utility\Httpie; |
11 | 11 | |
12 | 12 | // Title of project |
13 | -set('chat_title', function () { |
|
13 | +set('chat_title', function() { |
|
14 | 14 | return get('application', 'Project'); |
15 | 15 | }); |
16 | 16 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | set('chat_line2', '{{stage}}'); |
25 | 25 | |
26 | 26 | desc('Notifying Google Hangouts Chat'); |
27 | -task('chat:notify', function () { |
|
27 | +task('chat:notify', function() { |
|
28 | 28 | if (!get('chat_webhook', false)) { |
29 | 29 | return; |
30 | 30 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ->hidden(); |
68 | 68 | |
69 | 69 | desc('Notifying Google Hangouts Chat about deploy finish'); |
70 | -task('chat:notify:success', function () { |
|
70 | +task('chat:notify:success', function() { |
|
71 | 71 | if (!get('chat_webhook', false)) { |
72 | 72 | return; |
73 | 73 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ->hidden(); |
111 | 111 | |
112 | 112 | desc('Notifying Google Hangouts Chat about deploy failure'); |
113 | -task('chat:notify:failure', function () { |
|
113 | +task('chat:notify:failure', function() { |
|
114 | 114 | if (!get('chat_webhook', false)) { |
115 | 115 | return; |
116 | 116 | } |