After starting to use refinerycms I ran into some problems with my settings after deploying my app with capistrano.
First of all I was concerned with how the cms would work:
I ask my question and got some good answers - quick as well:
deployment to production with capistrano to vserver - consistency question regarding databases and cms settings - NOT heroku
Bottom line was:
For me it was not that easy at all because I used sqlite3 for developement and production and had to tell capistrano how to keep ONE database alive while rolling out releases:
in database.yml
And at the end of my deploy.rb
And it works fine so far!
First of all I was concerned with how the cms would work:
- somebody does something offline, e.g. coding a view
- and online somebody is writing a page or creating users
I ask my question and got some good answers - quick as well:
deployment to production with capistrano to vserver - consistency question regarding databases and cms settings - NOT heroku
Bottom line was:
- refinerycms is using files for settings
- online users will just work with the database,
- offline users/coders do scripting
- therefore merging is easy
For me it was not that easy at all because I used sqlite3 for developement and production and had to tell capistrano how to keep ONE database alive while rolling out releases:
in database.yml
production:
adapter: sqlite3
database: /var/www/*****/shared/production.sqlite3
pool: 5
timeout: 5000
adapter: sqlite3
database: /var/www/*****/shared/
pool: 5
timeout: 5000
And at the end of my deploy.rb
after "deploy:update_code", "preconfigure"
desc "Configure the application with correct database"
task :preconfigure, :roles => :app do
# symlink database.yml: copy if not exists, then link it back (release/config/database.yml -> shared/database.yml)
run "cp -n #{release_path}/config/database.yml #{shared_path}"
run "ln -sf #{shared_path}/database.yml #{release_path}/config/database.yml"
# symlink database file and backup current one
run "ln -sf #{shared_path}/production.sqlite3 #{release_path}/db/production.sqlite3"
run "touch #{release_path}/db/production.sqlite3" # make sure at least empty file exists so it can be copied
run "cp #{release_path}/db/production.sqlite3 #{release_path}/db/production.sqlite3.backup"
end
after 'deploy:update_code', 'deploy:migrate'
desc "Configure the application with correct database"
task :preconfigure, :roles => :app do
# symlink database.yml: copy if not exists, then link it back (release/config/database.yml -> shared/database.yml)
run "cp -n #{release_path}/config/
run "ln -sf #{shared_path}/database.yml #{release_path}/config/
# symlink database file and backup current one
run "ln -sf #{shared_path}/production.
run "touch #{release_path}/db/production.
run "cp #{release_path}/db/production.
end
after 'deploy:update_code', 'deploy:migrate'
And it works fine so far!
Kommentare
Kommentar veröffentlichen