Closed gansbrest closed 11 years ago
Why not just use a runner or something to link up the files manually after the bulk of them are copied?
Once thing you have to know about SCP is it's built into SSH, so it's by default include in both the capistrano and SSH actors and "just works" over the same SSH channel that's used for the command stream...
Maybe having a local tar.gz of the files and copying and then decompressing could be another solution.
All my configs are stored in the git repo and I have a wrapper class (will outsource it later) wich feeds those files to the transfer and verify commands. The configuration is manged by yaml file, so I'm specifying installation sequence there, eg
prod: prod/apache2: /etc shared/nginx: /etc
And I want all my files copied from source as is, including symlinks if any. It just doesn't makes sense for me to fix symlinks "manually" afterwards..
Hm, maybe I should come up with some archiving approach as you mentioned.. But it would be nice to just transfer as as ))
So git is symlink friendly? Never trying committed a symlink.
Yep, you can keep your symlinks in git easily. But you should keep track of symlinks destinations yourself, git doesnt care about it.
From the scp manpage:
-r Recursively copy entire directories. Note that scp follows sym-
bolic links encountered in the tree traversal.
No mention of symlinks in the Ruby docs: http://net-ssh.github.io/scp/v1/api/classes/Net/SCP.html
I think what you're seeing is the expected behavior. It will copy the files themselves, not the symlinks. I think what we need to do is document this behavior and someone should write a rsync installer or something (which does handle symlinks if I'm not mistake)... This gets complex though because ever actor does transfers differently.
Welcome to submit a patch if you find some nice way of doing this.
If someone wants to submit a pull request for an rsync installer that'd be great.
I use transfer to copy some config files to the server but it seems like symlinks gets converted into regular files.. Probably because transfer uses scp internally. Is there a way to preserve symlinks, maybe by replacing scp with rsync?