sprinkle-tool / sprinkle

Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails, or Sinatra stack on a brand new slice directly after its been created
https://github.com/sprinkle-tool/sprinkle
MIT License
1.15k stars 138 forks source link

Transfer should explain that it does not copy symlinks #66

Closed gansbrest closed 11 years ago

gansbrest commented 12 years ago

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?

joshgoebel commented 12 years ago

Why not just use a runner or something to link up the files manually after the bulk of them are copied?

joshgoebel commented 12 years ago

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...

joshgoebel commented 12 years ago

Maybe having a local tar.gz of the files and copying and then decompressing could be another solution.

gansbrest commented 12 years ago

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..

gansbrest commented 12 years ago

Hm, maybe I should come up with some archiving approach as you mentioned.. But it would be nice to just transfer as as ))

joshgoebel commented 12 years ago

So git is symlink friendly? Never trying committed a symlink.

gansbrest commented 12 years ago

Yep, you can keep your symlinks in git easily. But you should keep track of symlinks destinations yourself, git doesnt care about it.

joshgoebel commented 11 years ago

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.

joshgoebel commented 11 years ago

Welcome to submit a patch if you find some nice way of doing this.

joshgoebel commented 11 years ago

If someone wants to submit a pull request for an rsync installer that'd be great.