@@ -12,7 +12,7 @@ |
||
12 | 12 | set('writable_dirs', ['runtime']); |
13 | 13 | |
14 | 14 | desc('Runs Yii2 migrations for your project'); |
15 | -task('deploy:migrate', function () { |
|
15 | +task('deploy:migrate', function() { |
|
16 | 16 | run('cd {{release_or_current_path}} && {{bin/php}} yii migrate --interactive=0'); |
17 | 17 | }); |
18 | 18 |
@@ -71,37 +71,37 @@ discard block |
||
71 | 71 | ]); |
72 | 72 | |
73 | 73 | // This task remotely executes the `cache:clear` console command on the target server. |
74 | -task('sw:cache:clear', static function () { |
|
74 | +task('sw:cache:clear', static function() { |
|
75 | 75 | run('cd {{release_path}} && {{bin/console}} cache:clear --no-warmup'); |
76 | 76 | }); |
77 | 77 | |
78 | 78 | // This task remotely executes the cache warmup console commands on the target server, so that the first user, who |
79 | 79 | // visits the website, doesn't have to wait for the cache to be built up. |
80 | -task('sw:cache:warmup', static function () { |
|
80 | +task('sw:cache:warmup', static function() { |
|
81 | 81 | run('cd {{release_path}} && {{bin/console}} cache:warmup'); |
82 | 82 | run('cd {{release_path}} && {{bin/console}} http:cache:warm:up'); |
83 | 83 | }); |
84 | 84 | |
85 | 85 | // This task remotely executes the `database:migrate` console command on the target server. |
86 | -task('sw:database:migrate', static function () { |
|
86 | +task('sw:database:migrate', static function() { |
|
87 | 87 | run('cd {{release_path}} && {{bin/console}} database:migrate --all'); |
88 | 88 | }); |
89 | 89 | |
90 | -task('sw:plugin:refresh', function () { |
|
90 | +task('sw:plugin:refresh', function() { |
|
91 | 91 | run('cd {{release_path}} && {{bin/console}} plugin:refresh'); |
92 | 92 | }); |
93 | 93 | |
94 | -task('sw:scheduled-task:register', function () { |
|
94 | +task('sw:scheduled-task:register', function() { |
|
95 | 95 | run('cd {{release_path}} && {{bin/console}} scheduled-task:register'); |
96 | 96 | }); |
97 | 97 | |
98 | -task('sw:theme:refresh', function () { |
|
98 | +task('sw:theme:refresh', function() { |
|
99 | 99 | run('cd {{release_path}} && {{bin/console}} theme:refresh'); |
100 | 100 | }); |
101 | 101 | |
102 | 102 | // This task is not used per default, but can be used, e.g. in combination with `SHOPWARE_SKIP_THEME_COMPILE=1`, |
103 | 103 | // to build the theme remotely instead of locally. |
104 | -task('sw:theme:compile', function () { |
|
104 | +task('sw:theme:compile', function() { |
|
105 | 105 | run('cd {{release_path}} && {{bin/console}} theme:compile'); |
106 | 106 | }); |
107 | 107 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | return $plugins; |
114 | 114 | } |
115 | 115 | |
116 | -task('sw:plugin:update:all', static function () { |
|
116 | +task('sw:plugin:update:all', static function() { |
|
117 | 117 | $plugins = getPlugins(); |
118 | 118 | foreach ($plugins as $plugin) { |
119 | 119 | if ($plugin->installedAt && $plugin->upgradeVersion) { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | }); |
125 | 125 | |
126 | -task('sw:writable:jwt', static function () { |
|
126 | +task('sw:writable:jwt', static function() { |
|
127 | 127 | run('cd {{release_path}} && chmod -R 660 config/jwt/*'); |
128 | 128 | }); |
129 | 129 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | 'deploy:publish', |
151 | 151 | ]); |
152 | 152 | |
153 | -task('deploy:update_code')->setCallback(static function () { |
|
153 | +task('deploy:update_code')->setCallback(static function() { |
|
154 | 154 | upload('.', '{{release_path}}', [ |
155 | 155 | 'options' => [ |
156 | 156 | '--exclude=.git', |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | ]); |
161 | 161 | }); |
162 | 162 | |
163 | -task('sw-build-without-db:get-remote-config', static function () { |
|
163 | +task('sw-build-without-db:get-remote-config', static function() { |
|
164 | 164 | if (!test('[ -d {{current_path}} ]')) { |
165 | 165 | return; |
166 | 166 | } |
167 | - within('{{deploy_path}}/current', function () { |
|
167 | + within('{{deploy_path}}/current', function() { |
|
168 | 168 | run('{{bin/php}} ./bin/console bundle:dump'); |
169 | 169 | download('{{deploy_path}}/current/var/plugins.json', './var/'); |
170 | 170 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | }); |
174 | 174 | }); |
175 | 175 | |
176 | -task('sw-build-without-db:build', static function () { |
|
176 | +task('sw-build-without-db:build', static function() { |
|
177 | 177 | runLocally('CI=1 SHOPWARE_SKIP_BUNDLE_DUMP=1 ./bin/build-js.sh'); |
178 | 178 | }); |
179 | 179 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * Apply database migrations |
23 | 23 | */ |
24 | 24 | desc('Applies database migrations'); |
25 | -task('deploy:run_migrations', function () { |
|
25 | +task('deploy:run_migrations', function() { |
|
26 | 26 | run('FLOW_CONTEXT={{flow_context}} {{bin/php}} {{release_or_current_path}}/{{flow_command}} doctrine:migrate'); |
27 | 27 | }); |
28 | 28 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * Publish resources |
31 | 31 | */ |
32 | 32 | desc('Publishes resources'); |
33 | -task('deploy:publish_resources', function () { |
|
33 | +task('deploy:publish_resources', function() { |
|
34 | 34 | run('FLOW_CONTEXT={{flow_context}} {{bin/php}} {{release_or_current_path}}/{{flow_command}} resource:publish'); |
35 | 35 | }); |
36 | 36 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | set('cleanup_use_sudo', false); |
6 | 6 | |
7 | 7 | desc('Cleanup old releases'); |
8 | -task('deploy:cleanup', function () { |
|
8 | +task('deploy:cleanup', function() { |
|
9 | 9 | $releases = get('releases_list'); |
10 | 10 | $keep = get('keep_releases'); |
11 | 11 | $sudo = get('cleanup_use_sudo') ? 'sudo' : ''; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | set('copy_dirs', []); |
7 | 7 | |
8 | 8 | desc('Copies directories'); |
9 | -task('deploy:copy_dirs', function () { |
|
9 | +task('deploy:copy_dirs', function() { |
|
10 | 10 | if (has('previous_release')) { |
11 | 11 | foreach (get('copy_dirs') as $dir) { |
12 | 12 | // Make sure all path without tailing slash. |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use Deployer\Exception\GracefulShutdownException; |
5 | 5 | |
6 | 6 | desc('Locks deploy'); |
7 | -task('deploy:lock', function () { |
|
7 | +task('deploy:lock', function() { |
|
8 | 8 | $user = escapeshellarg(get('user')); |
9 | 9 | $locked = run("[ -f {{deploy_path}}/.dep/deploy.lock ] && echo +locked || echo $user > {{deploy_path}}/.dep/deploy.lock"); |
10 | 10 | if ($locked === '+locked') { |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | }); |
18 | 18 | |
19 | 19 | desc('Unlocks deploy'); |
20 | -task('deploy:unlock', function () { |
|
21 | - run("rm -f {{deploy_path}}/.dep/deploy.lock");//always success |
|
20 | +task('deploy:unlock', function() { |
|
21 | + run("rm -f {{deploy_path}}/.dep/deploy.lock"); //always success |
|
22 | 22 | }); |
23 | 23 | |
24 | 24 | desc('Checks if deploy is locked'); |
25 | -task('deploy:is_locked', function () { |
|
25 | +task('deploy:is_locked', function() { |
|
26 | 26 | $locked = test("[ -f {{deploy_path}}/.dep/deploy.lock ]"); |
27 | 27 | if ($locked) { |
28 | 28 | $lockedUser = run("cat {{deploy_path}}/.dep/deploy.lock"); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | // Cancel deployment if there would be no change to the codebase. |
8 | 8 | // This avoids unnecessary releases if the latest commit has already been deployed. |
9 | 9 | desc('Checks remote head'); |
10 | -task('deploy:check_remote', function () { |
|
10 | +task('deploy:check_remote', function() { |
|
11 | 11 | $repository = get('repository'); |
12 | 12 | |
13 | 13 | // Skip if there is no current deployment to compare |
@@ -2,7 +2,7 @@ |
||
2 | 2 | namespace Deployer; |
3 | 3 | |
4 | 4 | desc('Displays info about deployment'); |
5 | -task('deploy:info', function () { |
|
5 | +task('deploy:info', function() { |
|
6 | 6 | $releaseName = test('[ -d {{deploy_path}}/.dep ]') ? get('release_name') : 1; |
7 | 7 | |
8 | 8 | info("deploying <fg=magenta;options=bold>{{target}}</> (release <fg=magenta;options=bold>{$releaseName}</>)"); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // Returns Composer binary path in found. Otherwise try to install latest |
9 | 9 | // composer version to `.dep/composer.phar`. To use specific composer version |
10 | 10 | // download desired phar and place it at `.dep/composer.phar`. |
11 | -set('bin/composer', function () { |
|
11 | +set('bin/composer', function() { |
|
12 | 12 | if (test('[ -f {{deploy_path}}/.dep/composer.phar ]')) { |
13 | 13 | return '{{bin/php}} {{deploy_path}}/.dep/composer.phar'; |
14 | 14 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | }); |
25 | 25 | |
26 | 26 | desc('Installs vendors'); |
27 | -task('deploy:vendors', function () { |
|
27 | +task('deploy:vendors', function() { |
|
28 | 28 | if (!commandExist('unzip')) { |
29 | 29 | warning('To speed up composer installation setup "unzip" command with PHP zip extension.'); |
30 | 30 | } |