How to deploy files from local folder /my/local/folder into /remote/destination ?
How do I have to setup the path mappings to deploy as mentioned in my question ? I currently use the following deployment configs, but this does not do as needed:
Path Mappings:
Local Path | Deployment Path | Web Path
---------------------------+------------------------------+------------------------------
/absolute/my/local/folder | /abs/remote/destination | /destination
---------------------------+------------------------------+------------------------------
/absolute | / | /
The result of this config is that the /absolute/my/local/folder gets deployed to /abs/my/local/folder, and the /abs/remote/destination contents remain unchanged. I'm deploying using ssh and rsynch, if that even matters, and the SSH connection properly works, no issues.
Help?
Please sign in to leave a comment.
Hi,
I remember seeing a report on a forum where exclusions did not work when “rsync” is enabled, so I wonder if we got something similar here. Does it work if you untick “rsync”?
I'll give it a try. So this means that the mapping above is correct? How do I avoid at the same time that
/absolute/my/local/folder
gets deployed to
/abs/remote/folder?
> So this means that the mapping above is correct?
At the quick glance, it is. However, I have not seen “Root path”. What path did you set there?
Here is a similar scenario that I have just tested:
Not sure if I got this point correctly though. Isn't that something that you need to achieve?
The server's root path, and it works fine.
Yes indeed, but only for the staging server / environment. In production, I have to prevent that deployment. I know found out with a few tests that excluding specific paths from deployment works both with and without rsynch enabled. But distinct path mapping (e.g.
/absolute/projectroot/local/folder
to/abs/remote/destination
, as in this example), indeed fails when using rsynch (deploys/absolute/projectroot/local/folder
to/absolute/serverroot/local/folder
).The solution we've set for now thus is the following:
This seems to work as intended, hence two follow-up questions:
/absolute/local/projectroot/my/sub/folder
instead of/absolute/local/projectroot
), is my assumption correct that this will exclusively deploy what's inside/absolute/local/projectroot/my/sub/folder
, and ignore files / directories above the/absolute/local/projectroot/my/sub/folder
, yes? And this will not change anytime soon with updates of the IDE? We would like to know this, as you can imagine, for the security of the integrity of our deployment cycles.Hi,
Thank you for your reply.
In the meantime, I have managed to reproduce this issue (at least, on Windows) and may confirm that multiple mappings are simply ignored when Rsync is enabled. Here is my brand new report about it:
https://youtrack.jetbrains.com/issue/WI-75333/Rsync-Additional-mappings-are-ignored
The first workaround that I may think of is to create several deployment configurations (even pointing to the same servers) each with its own single and precise granular mapping (to avoid the aforementioned issue). In theory, it should work.
Deployment and SSH configurations can be saved with the project ("Visible for this project" option).
As for other settings, you may export/import these manually or share via the Settings Repository:
https://www.jetbrains.com/help/phpstorm/sharing-your-ide-settings.html