Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shayfrendt/74216 to your computer and use it in GitHub Desktop.
Save shayfrendt/74216 to your computer and use it in GitHub Desktop.
# Callbacks
before "deploy:setup", "sqlite3:config"
after "deploy:update_code", "sqlite3:symlink"
# Tasks
namespace :sqlite3 do
desc "Configure the shared path to contain a persistent sqlite3 database"
task :config do
run "mkdir -p #{shared_path}/db"
run "touch #{shared_path}/db/production.sqlite3"
end
desc "Symlink the database file from the shared path to the release path"
task :symlink do
run "ln -nsf #{shared_path}/db/production.sqlite3 #{release_path}/db/production.sqlite3"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment