Just read in the Capistrano manual about the Capistrano “migrate” task.
There it says that:
“By default, all this task does is change to the directory of your
current release (as indicated by the current symlink), and run rake
RAILS_ENV=production migrate. You can specify that it should run against
the latest release (regardless of what the current release is) by
setting the migrate_target variable to :latest before invoking this
task. Likewise, if you want to specify additional environment variables
(beside RAILS_ENV) you can set the migrate_env variable to the
space-delimited list of name=value pairs to use.”
Can anyone verify the truth of this statement.
Currently I use Capistrano to deploy to a test environment, so I’d like
to be able to run my migrations against test.
Can you modify the RAILS_ENV that Capistrano is using to do the
migration or not?
I think I will just add the “rake migrate RAILS_ENV=test” command as a
command line to run within my deploy script. That should work, no?