Ruby on Rails Wednesday, February 29, 2012

On 29 February 2012 10:42, Bert Gloan <lists@ruby-forum.com> wrote:
> Currently I have been doing the usual cap deployments for a project to a
> test environment as my app develops. Nothing exciting, but I have now
> got to deploy it on a reasonable scale to a DMZ that has no access to
> the git repo/ or any other nice things.
>
> Anyone got 'best practice' for this situation, I can push to the DMZ
> using ssh/scp etc, even rsync ... but rather than a cobbled together
> approach, I would prefer good practice.

I use a script that touches the local tmp/restart.txt (which, for me
anyway, causes the server to restart) then uses rsync to update the
server then using ssh run the remote command to precompile the assets.
For the actual file transfer rsync is amazingly fast (particularly if
the server is remote) as the connection is only made once.

If any gems have changed you will need to bundle install on the server
also, but I do this manually if required. Also if migrations have
been added then you will need to run the migrations.

For the rsync I have an ignore file containing:
.git
.gitignore
.rvmrc
.bundle
doc
log
db/schema.rb
tmp/cache
tmp/pids
tmp/sesssions
tmp/sockets
tmp/markup
test
spec
public/javascripts/all.js
public/assets
vendor/bundle
.bundle/config

I too will be interested to hear of other suggestions.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment