Skip to content

Allow deployer to remove folder/files when deploying #3251

@nvision-luxembourg

Description

@nvision-luxembourg

Hello,

I did not find any doc about this, maybe it's alresay done.

If not, is it possible to add a feature that allow deployer to remove files that are not needed.

It can be configured as the shared_dirs/files and why not included in the cleanup.php with the same process as done in shared.php but with an rm instead of a mkdir

Differents variables like :

set('delete_dirs', array_merge(get('delete_dirs'), ['.git'], [docker]));
set('delete_files', array_merge(get('delete_files'), ['.gitignore'], [docker-compose.yml]));

With a function like

foreach (get('delete_dirs') as $dir) {
        // Make sure all path without tailing slash.
        $dir = trim($dir, '/');

        // Check if dir does not exist.
        if (test("[ -d $dir ]")) {
            // delete dir if it does exist.
            run("rm -rf $sharedPath/$dir");
        }

So we can remove all files that aren't needed for the application (ex: docker files and stuff)

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions