Run a task on the old releases? #3166
Answered
by
alexislefebvre
alexislefebvre
asked this question in
Help needed
-
Is is possible to run a task on a old release after a new deployment, or on all releases except the current one? My use case: I would want to run |
Beta Was this translation helpful? Give feedback.
Answered by
alexislefebvre
Jun 15, 2022
Replies: 1 comment
-
I should try to write a custom command, based on It would call Here is my solution: before('cleanup', 'cleanup:cache-pool-prune');
task('cleanup:cache-pool-prune', function () {
$releases = get('releases_list');
// ignore the last release
array_shift($releases);
foreach ($releases as $release) {
run('cd {{deploy_path}}/releases/'.$release.' && bin/console cache:pool:prune');
}
})->desc('Prune the pool of previous releases'); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
alexislefebvre
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I should try to write a custom command, based on
cleanup
: https://github.com/deployphp/deployer/blob/6.x/recipe/deploy/cleanup.phpIt would call
php bin/console cache:pool:prune
instead ofrm
Here is my solution: