Hi,

I'm using Capistrano on Windows

I have some code in 'Capfile' which reads like this -

task :start, :roles => :app do
   run "rm -rf  ./public_html;  ln -s ./#{application}/current/
public  ./public_html"
   run "rm -rf  ./database;  ln -s  ./database  ./#{application}/
current/db/sqlite"
end



Here what am I basically trying to do is, that in my `database.yml`
file, I use `db/sqlite/production.sqlite3` as the database path, but
since in each deployment, Capistrano is going to make a fresh copy of
the directories in "application_path/releases/{timestamp}" directory,
I'll have a fresh copy of the database after each deployment.

To solve this issue, I tried to symlink the "application_path/current/
db/sqlite" directory to "my_home_path/database" directory in each
deployment so that I'm accessing the same database after each
deployment stored in "my_home_path/database" directory.

However the problem is that since this symlinking line is in
"task :start" block, when I do "cap deploy:cold", this line gets
executed after all the migrations have finished.

To solve this issue, I tried to write that line in
"task :migrate, :roles => :app" block, but that doesn't seems to
resolve the issue.

I wanted to know that when I run "cap deploy:cold", how can I make
this database symlinking right after the "current" directory is
symlinked to "release/{timestamp}" and before the task deploy:migrate
runs.

I have also doubt that writing my own "task :migrate" may overwrite
its default behaviour.

Any suggestions?

I'm new to Capistrano, forgive me if I'm doing some kind of 'silly'
mistakes.

-thanks.

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to