Sha256: aa55f3fa5c82859357bfdf37e19e88cb4d6001141f592d6a3f07b4c20670ac61

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 Bytes

Contents

namespace :db do
  desc 'Setup db configuration.'
  task :setup do
    on roles(:app) do
      execute "mkdir -p #{fetch(:shared_path)}/config"
      template 'database.yml.erb', "#{fetch(:shared_path)}/config/database.yml"
    end
  end
  desc 'Run rake db:seed.'
  task :seed do
    on roles(:app) do
      within release_path do
        with rails_env: fetch(:rails_env) do
          execute :rake, 'db:seed'
        end
      end
    end
  end
  desc 'Create empty database file'
  task :create_file do
    on roles(:app) do
      execute :mkdir, '-p', "#{fetch(:shared_path)}/config"
      if test("[ -f #{fetch(:shared_path)}/config/database.yml ]")
        debug "#{fetch(:shared_path)}/config/database.yml file is exist"
      else
        info "#{fetch(:shared_path)}/config/database.yml file does not exist, and it has been created"
        template 'database.yml.erb', "#{fetch(:shared_path)}/config/database.yml"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
recipes_matic-1.3.0 lib/generators/recipes_matic/templates/lib/capistrano/tasks/db.rake