PHPloy icon indicating copy to clipboard operation
PHPloy copied to clipboard

After purge with purge-before[] files/dirs do not loaded into this directory

Open Glashkoff opened this issue 5 years ago • 3 comments

Hi. I'm not understanding setting purge-before []. My repo contains:

/dir1
/dir1/file_in_dir_1
/dir2
/dir2/file_in_dir_2
file1
file2

phploy.ini:

[production]
    scheme = 'sftp'
    user = '#'
    pass = '#'
    host = #
    path = /var/www/#/htdocs/
    port = #
    branch = master
    permissions = 0700
    directoryPerm = 0775
    exclude[] = '*.bak'
    exclude[] = '*.log'
    exclude[] = '.vscode'
    purge-before[] = "dir2/"

I do phploy --fresh and see in log:

SERVER: production
Purging directory dir2/
....

And in the dir2 directory there were files only from the repo, everything is OK. Next, I run phploy and dir2 is cleared up. That is the same as if I used purge [] Is this normal behavior?

Glashkoff avatar Sep 16 '19 22:09 Glashkoff

After three weeks of use, I came to the conclusion that purge-before[] works just like purge[].

Glashkoff avatar Oct 12 '19 09:10 Glashkoff

Hi! purge-before works just like purge, the only difference is that purge-before runs before any uploads and purge runs after uploads. I use it to clear a directory (that is not tracked by git) before uploading new files to it. In my case it's js and css files generated by webpack that have unique names so the old files don't get overwritten and needs to be removed. I hope this helps clear it up!

Liingon avatar Oct 21 '19 12:10 Liingon

@Liingon thanks for the answer. Does this mean that uploads should not happen at all for such directories? Unfortunately, in my case, after purge-before, the directory remains empty, although there are files in the repository.

Glashkoff avatar Oct 21 '19 13:10 Glashkoff