How do you manage your server to laptop file syncing?
I've got a web server configured and ready to start using a live
development server. I have been using sftpdrive and just developing
straight on the server... but sometimes I don't have internet access.
I was thinking that I could just make a copy on my laptop for offline
development but I don't think that would be too efficient. I mean, I
don't want to download a copy and upload a copy at the beginning and
end of a dev session.
Is there a good way to handle this issue?
BTW: I am uploading and downloading files to & from my server using
sftp.
What OS are you using? In linux you could just write a script to
automate the process. Might be able to do it in a batch file but I
don't know about that.
you could use bazaar or mercurial for your sourcecode management and its
fairly simple to use with remote branches over sftp. and its pretty
cheap on network transfers since it only transfers changesets.
(and these tools are useful in so many more ways, checkout their
homepages for more info)
Well the "professional" rails way is to do the development on the
laptop, keeping everything under version control (usually using
subversion) and use capistrano to deploy the application to the
server.
The intermittent internet access makes things a bit more difficult,
because of access to the version control repository. Capistrano works
best when the server machine(s) have access to the same repository as
the development machine(s) this usually means that you want to put
the repository on a server of some type which means that you either
need to hold off committing changes until you do have internet access,
or keep the repository on your laptop and arrange for the server to
have access ot the laptop at deploy time, or use something like
git-svn which allows you to have a local git repository on the laptop
and do local commits which can then be synced to the subversion
repository when you do have access to it.
Googling for capistrano rails would be a good start to understanding
what I've just said.
Another possibility is to use git or mercurial on the laptop (if it's Windows, I've read that mercurial works better) and the server, doing all development on the laptop, committing regularly. Then when you're ready to release, sync up the remote git/hg repository with what's on the laptop. Then tell capistrano to use the remote repository for deployment as it has support for git and mercurial. Then you don't have to worry about not committing when you don't have internet access. There's some quite interesting reading about distributed scm.
Yes, Capistrano 2.0 is much less opinionated about scm plumbing. On
the other hand there are still a lot of things in Rails like plugins,
and freezing which are implemented around svn, so I still think that
it's the best place to keep the 'real' repository. The fact that git
works well WITH SVN, despite Linus' opinions of SVN as the spawn of
satan (i.e. CVS), makes using the combination attractive.
Like so many other things, personal preferences and requirements dictate much of what we do. I don't use many plugins, and don't use svn. I am using hg because I like to have everything on my notebook for those times I am not near an internet connection, which, even in this day of high connectivity, is quite often.
I'm glad we have choices. I'd hate to think what development would be like if we all had to do things the same way. I'd probably do something else, like shovel horse poop.
Anyone know of a good walk-through tutorial that shows someone how to
do this?
Ie. use mercurial on the laptop and the server, doing all development
on the laptop, committing regularly. Then when you're ready to
release, sync up the remote git/hg repository with what's on the
laptop. Then tell capistrano to use the remote repository for
deployment as it has support for git and mercurial.