fix: cachetool 404 on deploy
This commit is contained in:
+13
-3
@@ -84,7 +84,10 @@ set('http_user', 'myepsf');
|
|||||||
// Must stay here: contrib/rsync.php sets the same key, but its __DIR__ is the vendor dir.
|
// Must stay here: contrib/rsync.php sets the same key, but its __DIR__ is the vendor dir.
|
||||||
set('rsync_src', __DIR__);
|
set('rsync_src', __DIR__);
|
||||||
set('rsync', $rsyncOptions);
|
set('rsync', $rsyncOptions);
|
||||||
set('cachetool_args', '--web=SymfonyHttpClient --web-path={{release_or_current_path}}/public/ --web-url={{web_url}}');
|
// The web adapter fetches its probe file back through the live docroot, so --web-path must
|
||||||
|
// be the current symlink, never {{release_or_current_path}}: that one resolves (and memoizes)
|
||||||
|
// to the new release dir, which the FPM worker's realpath cache does not see yet.
|
||||||
|
set('cachetool_args', '--web=SymfonyHttpClient --web-path={{current_path}}/public/ --web-url={{web_url}}');
|
||||||
|
|
||||||
host('prod')
|
host('prod')
|
||||||
->setHostname('dedi10193.your-server.de')
|
->setHostname('dedi10193.your-server.de')
|
||||||
@@ -116,7 +119,12 @@ task('deploy', [
|
|||||||
'deploy:writable',
|
'deploy:writable',
|
||||||
'deploy:cache:warmup',
|
'deploy:cache:warmup',
|
||||||
'database:migrate',
|
'database:migrate',
|
||||||
|
// Must run before the symlink flip: the cachetool probe file is only reachable through
|
||||||
|
// the release the docroot currently resolves to. It still pays off, because it drops the
|
||||||
|
// opcache entries keyed under current/public/*.
|
||||||
|
'cachetool:clear:opcache',
|
||||||
'deploy:publish',
|
'deploy:publish',
|
||||||
|
'deploy:stop-workers',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Purely local, so it runs before anything is created on the remote. once(), so
|
// Purely local, so it runs before anything is created on the remote. once(), so
|
||||||
@@ -134,7 +142,9 @@ task('deploy:cache:warmup', function () {
|
|||||||
run('{{bin/console}} cache:warmup {{console_options}}');
|
run('{{bin/console}} cache:warmup {{console_options}}');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Opcache has to be reset once the new release is actually live.
|
// Workers keep running the previous release's code until they are told to stop.
|
||||||
after('deploy:symlink', 'cachetool:clear:opcache');
|
task('deploy:stop-workers', function () {
|
||||||
|
run('{{bin/console}} messenger:stop-workers');
|
||||||
|
});
|
||||||
|
|
||||||
after('deploy:failed', 'deploy:unlock');
|
after('deploy:failed', 'deploy:unlock');
|
||||||
|
|||||||
Reference in New Issue
Block a user