@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | //Create and upload Drupal 7 settings.php using values from secrets |
45 | -task('drupal:settings', function () { |
|
45 | +task('drupal:settings', function() { |
|
46 | 46 | if (askConfirmation('Are you sure to generate and upload settings.php file?')) { |
47 | 47 | |
48 | 48 | //Get template |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $replacements = []; |
60 | 60 | foreach ($iterator as $key => $value) { |
61 | 61 | $keys = []; |
62 | - for ($i = $iterator->getDepth(); $i > 0; $i --) { |
|
62 | + for ($i = $iterator->getDepth(); $i > 0; $i--) { |
|
63 | 63 | $keys[] = $iterator->getSubIterator($i - 1)->key(); |
64 | 64 | } |
65 | 65 | $keys[] = $key; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | }); |
85 | 85 | |
86 | 86 | //Upload Drupal 7 files folder |
87 | -task('drupal:upload_files', function () { |
|
87 | +task('drupal:upload_files', function() { |
|
88 | 88 | if (askConfirmation('Are you sure?')) { |
89 | 89 | upload('sites/{{drupal_site}}/files', '{{deploy_path}}/shared/sites/{{drupal_site}}/files'); |
90 | 90 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | 'storage/logs', |
24 | 24 | ]); |
25 | 25 | set('log_files', 'storage/logs/*.log'); |
26 | -set('laravel_version', function () { |
|
26 | +set('laravel_version', function() { |
|
27 | 27 | $result = run('{{bin/php}} {{release_path}}/artisan --version'); |
28 | 28 | preg_match_all('/(\d+\.?)+/', $result, $matches); |
29 | 29 | return $matches[0][0] ?? 5.5; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | function artisan($command, $options = []) |
48 | 48 | { |
49 | - return function () use ($command, $options) { |
|
49 | + return function() use ($command, $options) { |
|
50 | 50 | $versionTooEarly = array_key_exists('min', $options) |
51 | 51 | && laravel_version_compare($options['min'], '<'); |
52 | 52 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @see https://laravel.com/docs/5.2/filesystem#configuration |
169 | 169 | */ |
170 | 170 | desc('Make symlink for public disk'); |
171 | -task('deploy:public_disk', function () { |
|
171 | +task('deploy:public_disk', function() { |
|
172 | 172 | // Remove from source. |
173 | 173 | run('if [ -d $(echo {{release_path}}/public/storage) ]; then rm -rf {{release_path}}/public/storage; fi'); |
174 | 174 |
@@ -25,14 +25,14 @@ |
||
25 | 25 | /** |
26 | 26 | * Clear cache |
27 | 27 | */ |
28 | -task('deploy:cache:clear', function () { |
|
28 | +task('deploy:cache:clear', function() { |
|
29 | 29 | run("cd {{release_path}} && php -r \"require_once 'app/Mage.php'; umask(0); Mage::app()->cleanCache();\""); |
30 | 30 | })->desc('Clear cache'); |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Remove files that can be used to compromise Magento |
34 | 34 | */ |
35 | -task('deploy:clear_version', function () { |
|
35 | +task('deploy:clear_version', function() { |
|
36 | 36 | run("rm -f {{release_path}}/LICENSE.html"); |
37 | 37 | run("rm -f {{release_path}}/LICENSE.txt"); |
38 | 38 | run("rm -f {{release_path}}/LICENSE_AFL.txt"); |
@@ -25,14 +25,14 @@ |
||
25 | 25 | /** |
26 | 26 | * Apply database migrations |
27 | 27 | */ |
28 | -task('deploy:run_migrations', function () { |
|
28 | +task('deploy:run_migrations', function() { |
|
29 | 29 | run('FLOW_CONTEXT={{flow_context}} {{bin/php}} {{release_path}}/{{flow_command}} doctrine:migrate'); |
30 | 30 | })->desc('Apply database migrations'); |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Publish resources |
34 | 34 | */ |
35 | -task('deploy:publish_resources', function () { |
|
35 | +task('deploy:publish_resources', function() { |
|
36 | 36 | run('FLOW_CONTEXT={{flow_context}} {{bin/php}} {{release_path}}/{{flow_command}} resource:publish'); |
37 | 37 | })->desc('Publish resources'); |
38 | 38 |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | set('dump_assets', false); |
37 | 37 | |
38 | 38 | // Environment vars |
39 | -set('env', function () { |
|
39 | +set('env', function() { |
|
40 | 40 | return [ |
41 | 41 | 'SYMFONY_ENV' => get('symfony_env') |
42 | 42 | ]; |
43 | 43 | }); |
44 | 44 | |
45 | -set('composer_options', function () { |
|
45 | +set('composer_options', function() { |
|
46 | 46 | $debug = get('symfony_env') === 'dev'; |
47 | 47 | return sprintf('{{composer_action}} --verbose --prefer-dist --no-progress --no-interaction %s --optimize-autoloader --no-suggest', (!$debug ? '--no-dev' : '')); |
48 | 48 | }); |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | set('var_dir', 'app'); |
54 | 54 | |
55 | 55 | // Symfony console bin |
56 | -set('bin/console', function () { |
|
56 | +set('bin/console', function() { |
|
57 | 57 | return sprintf('{{release_path}}/%s/console', trim(get('bin_dir'), '/')); |
58 | 58 | }); |
59 | 59 | |
60 | 60 | // Symfony console opts |
61 | -set('console_options', function () { |
|
61 | +set('console_options', function() { |
|
62 | 62 | $options = '--no-interaction --env={{symfony_env}}'; |
63 | 63 | return get('symfony_env') !== 'prod' ? $options : sprintf('%s --no-debug', $options); |
64 | 64 | }); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * Create cache dir |
72 | 72 | */ |
73 | -task('deploy:create_cache_dir', function () { |
|
73 | +task('deploy:create_cache_dir', function() { |
|
74 | 74 | // Set cache dir |
75 | 75 | set('cache_dir', '{{release_path}}/' . trim(get('var_dir'), '/') . '/cache'); |
76 | 76 | |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | /** |
89 | 89 | * Normalize asset timestamps |
90 | 90 | */ |
91 | -task('deploy:assets', function () { |
|
92 | - $assets = implode(' ', array_map(function ($asset) { |
|
91 | +task('deploy:assets', function() { |
|
92 | + $assets = implode(' ', array_map(function($asset) { |
|
93 | 93 | return "{{release_path}}/$asset"; |
94 | 94 | }, get('assets'))); |
95 | 95 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | /** |
101 | 101 | * Install assets from public dir of bundles |
102 | 102 | */ |
103 | -task('deploy:assets:install', function () { |
|
103 | +task('deploy:assets:install', function() { |
|
104 | 104 | run('{{bin/php}} {{bin/console}} assets:install {{console_options}} {{release_path}}/web'); |
105 | 105 | })->desc('Install bundle assets'); |
106 | 106 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | /** |
109 | 109 | * Dump all assets to the filesystem |
110 | 110 | */ |
111 | -task('deploy:assetic:dump', function () { |
|
111 | +task('deploy:assetic:dump', function() { |
|
112 | 112 | if (get('dump_assets')) { |
113 | 113 | run('{{bin/php}} {{bin/console}} assetic:dump {{console_options}}'); |
114 | 114 | } |
@@ -117,14 +117,14 @@ discard block |
||
117 | 117 | /** |
118 | 118 | * Clear Cache |
119 | 119 | */ |
120 | -task('deploy:cache:clear', function () { |
|
120 | +task('deploy:cache:clear', function() { |
|
121 | 121 | run('{{bin/php}} {{bin/console}} cache:clear {{console_options}} --no-warmup'); |
122 | 122 | })->desc('Clear cache'); |
123 | 123 | |
124 | 124 | /** |
125 | 125 | * Warm up cache |
126 | 126 | */ |
127 | -task('deploy:cache:warmup', function () { |
|
127 | +task('deploy:cache:warmup', function() { |
|
128 | 128 | run('{{bin/php}} {{bin/console}} cache:warmup {{console_options}}'); |
129 | 129 | })->desc('Warm up cache'); |
130 | 130 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Migrate database |
134 | 134 | */ |
135 | -task('database:migrate', function () { |
|
135 | +task('database:migrate', function() { |
|
136 | 136 | $options = '{{console_options}} --allow-no-migration'; |
137 | 137 | if (get('migrations_config') !== '') { |
138 | 138 | $options = sprintf('%s --configuration={{release_path}}/{{migrations_config}}', $options); |
@@ -8,25 +8,25 @@ |
||
8 | 8 | |
9 | 9 | add('writable_dirs', ['public/uploads']); |
10 | 10 | |
11 | -set('bin/websiteconsole', function () { |
|
11 | +set('bin/websiteconsole', function() { |
|
12 | 12 | return parse('{{bin/php}} {{release_path}}/bin/websiteconsole --no-interaction'); |
13 | 13 | }); |
14 | 14 | |
15 | 15 | desc('Migrate PHPCR'); |
16 | 16 | task( |
17 | 17 | 'phpcr:migrate', |
18 | - function () { |
|
18 | + function() { |
|
19 | 19 | run('{{bin/php}} {{bin/console}} phpcr:migrations:migrate'); |
20 | 20 | } |
21 | 21 | ); |
22 | 22 | |
23 | 23 | desc('Clear cache'); |
24 | -task('deploy:website:cache:clear', function () { |
|
24 | +task('deploy:website:cache:clear', function() { |
|
25 | 25 | run('{{bin/websiteconsole}} cache:clear --no-warmup'); |
26 | 26 | }); |
27 | 27 | |
28 | 28 | desc('Warm up cache'); |
29 | -task('deploy:website:cache:warmup', function () { |
|
29 | +task('deploy:website:cache:warmup', function() { |
|
30 | 30 | run('{{bin/websiteconsole}} cache:warmup'); |
31 | 31 | }); |
32 | 32 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /** |
20 | 20 | * Run migrations |
21 | 21 | */ |
22 | -task('deploy:run_migrations', function () { |
|
22 | +task('deploy:run_migrations', function() { |
|
23 | 23 | run('{{bin/php}} {{release_path}}/yii migrate up --interactive=0'); |
24 | 24 | })->desc('Run migrations'); |
25 | 25 |
@@ -35,14 +35,14 @@ |
||
35 | 35 | /** |
36 | 36 | * Initialization |
37 | 37 | */ |
38 | -task('deploy:init', function () { |
|
38 | +task('deploy:init', function() { |
|
39 | 39 | run('{{bin/php}} {{release_path}}/init --env=Production --overwrite=n'); |
40 | 40 | })->desc('Initialization'); |
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Run migrations |
44 | 44 | */ |
45 | -task('deploy:run_migrations', function () { |
|
45 | +task('deploy:run_migrations', function() { |
|
46 | 46 | run('{{bin/php}} {{release_path}}/yii migrate up --interactive=0'); |
47 | 47 | })->desc('Run migrations'); |
48 | 48 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | namespace Deployer; |
9 | 9 | |
10 | 10 | desc('Copy directories'); |
11 | -task('deploy:copy_dirs', function () { |
|
11 | +task('deploy:copy_dirs', function() { |
|
12 | 12 | if (has('previous_release')) { |
13 | 13 | foreach (get('copy_dirs') as $dir) { |
14 | 14 | if (test("[ -d {{previous_release}}/$dir ]")) { |