How to upload files to more than one location?


Hello! I've got a project at a remoted server available via ssh and I'm trying to set deployment settings so it can upload my local files to some dirs like local_project/bin/scripts/js -> remote_server/bin/scripts/js and local_project/bin/scripts/js -> remote_server/public/js
but phpStorm doesn't allow me to do it:

When I try to add the same local dir to the "mapping" tab of deployment settings it shows me an error, but when I try to add the project's root dir -> server's root dir and the bin dir to server's public dir to the mapping (for example local_project/ -> remote_server/ and local_project/bin/scripts/js -> remote_server/public/js), it stops uploading files to the server's bin dir and upload them only to the public dir.

It looks like phpStorm can't upload the same file to more than one directory. Am I doing something wrong or is it a feature?

3 comments
Comment actions Permalink

Hello,

when there are multiple mappings for a file, the first of the nearest ones is used, so, multiple mappings won't help you. Current workaround is to create a symlink on server to get changes in both directories. If it is somewhat inconvenient, try to use workaround for multiple hosts: add the same host two times and set up deployment mappings to the remote  locations you need. Then use 'Upload to' action to choose which "alias"  to upload to. Still automatic upload will be using default server only. Then you might want to vote for issue Upload files on multiple (S)FTP servers at once.

Best regards,
Elena Shaverdova

0
Comment actions Permalink

Thank you, Elena. Unfortunately symlinks are unacceptable for my situation, so I voted for the issue http://youtrack.jetbrains.com/issue/WI-909

0
Comment actions Permalink

Personnaly, I have created a simple python script upload.py located on my project root and I call it through external tools to upload to different servers.
The scrupt is very simple and I have assigned a keyboard shortcut to upload easilly to all servers at once.
I can publish the source code if you want.

The only restriction (for now) is that I have to upload my files one by one because I have not found a macro for all selected files.

0

Please sign in to leave a comment.