Skip to content
Discussion options

You must be logged in to vote

I should try to write a custom command, based on cleanup: https://github.com/deployphp/deployer/blob/6.x/recipe/deploy/cleanup.php

It would call php bin/console cache:pool:prune instead of rm


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');

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexislefebvre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant