No commit activity in last 3 years
No release in over 3 years
Capistrano tasks for automating linking a sqlite db in Rails 4+. If a database is already found on remote server, then it copies to shared location and links, otherwise it lets other task generate db.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0

Runtime

 Project Readme

Capistrano::SqliteReuse

Capistrano tasks for handling sqlite dbs when deploying Rails 4+ apps.

Install

Add this to Gemfile:

group :development do
  gem 'capistrano', '~> 3.2.1'
  gem 'capistrano-sqlite-reuse', '~> 1.0.0'
end

And then:

$ bundle install

Setup and usage

  • add to Capfile:

      require 'capistrano/sqlite_reuse'
    

You can now proceed with other deployment tasks.

How it works

On deployment:

  • we look for database.yml file to read the database location on the server
  • if it exists, we add to linked files
  • if not we look for file in current deployment, if it exists, we copy to shared and add to linked
  • if nothing exists, then we allow database to be generated normally and it will be shared on next deploy.