Some thing almost exactly like this: ;-)
after "deploy:symlink_configs", "update_shared"
desc 'Symlink the local configuration files that are not under source
control'
task :update_shared, :roles => :app, :except => { :no_release =>
true } do
run <<-DONE
ln -nfs #{shared_path}/local_image #{release_path}/
public/local_image ;
ln -nfs #{shared_path}/site_images #{release_path}/
public/site_images ;
ln -nfs #{shared_path}/blog_images #{release_path}/
public/blog_images ;
ln -nfs #{shared_path}/cache #{release_path}/
public/cache ;
ln -nfs #{shared_path}/datafeeds #{release_path}/
tmp/datafeeds
DONE
end
-Rob
On May 19, 2010, at 3:03 AM, Jordi Noguera Leon wrote:
Yes, it is clear now. Then to make it work I have to add an upload
folder to shared_children and add the symlink, which should be
something like 'ln -s {app_dir}/shared/upload {app_dir}/releases/
[current_release}', is that correct?
And to set the rails environment, do you know any way?
Thanks
Jordi
On 18 May 2010 20:08, Lee Hambley <[email protected]> wrote:
So, to address your query, it looks like this - say you deploy to `/
u/apps` the structure in there looks something like:
/u/apps/whatever.com/releases/
/u/apps/whatever.com/releases/<timestamp>
/u/apps/whatever.com/releases/<timestamp>
/u/apps/whatever.com/releases/<timestamp>
/u/apps/whatever.com/releases/<timestamp>
/u/apps/whatever.com/releases/<timestamp>
Where the timestamp is the date with the punctuation removed like
20101805210300 - each time you deploy this is generated, and your
app is checked-out into it from Git (ok, there are optimisations.)
So naturally if your images aren't in the Git repository, they won't
make it into the release directory, as it is commonly known.
Finally, assuming you have no errors, the directory `/u/apps/
current`, isn't actually a directory - it's a symlink to the most
recent successful release.
To bypass the problem of resources that aren't version controlled
(pid files, log files, uploads, etc) there's a shared directory, so
it looks something like this:
/u/apps/whatever.com/releases/
/u/apps/whatever.com/releases/20101005153405
/u/apps/whatever.com/releases/20101805210300
/u/apps/whatever.com/current @=> /u/
apps/releases/20101805210300
/u/apps/whatever/shared
/u/apps/whatever/shared/pids
/u/apps/whatever/shared/tmp
/u/apps/whatever/shared/log
The shared directory are then linked from the release directory, so
they `persist` between deploys.
The reason it this works this way is so that if during a deploy
something goes wrong, there's no problems to just abort, and throw
away the directory we were just working in, and never change the
symlink to the new directory.
Any clearer?
--
* You received this message because you are subscribed to the Google
Groups "Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
--
* You received this message because you are subscribed to the Google
Groups "Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
--
* You received this message because you are subscribed to the Google Groups
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/capistrano?hl=en