Prepare capistrano/db migrations to support more setups (#2)

The following parameters have been added to deploy-secrets.yml:

* **use_rvm**: yes/no
* **ruby_version**: Ruby version for rvm. Defaults to 2.3.2
* **repository**: Git repository. Defaults to the oficial repository
* **branch**: Branch to deploy. Defaults to master
* **rails_env**: Defaults to the stage.

Fixed migrations that required admin rights. Now first check if the postgress extensions are available. If so finish without doing nothin.

Added support for passenger.
This commit is contained in:
Juan Salvador Pérez García
2018-06-08 11:51:44 +02:00
parent 77dd60427d
commit 1db5a00eae
10 changed files with 61 additions and 21 deletions

View File

@@ -1,5 +1,11 @@
class AddUnaccentExtension < ActiveRecord::Migration
def change
execute "create extension if not exists unaccent"
return if extension_enabled?('unaccent')
begin
enable_extension 'unaccent'
rescue StandardError => e
raise "Could not create extension unaccent. Please contact with your system administrator: #{e}"
end
end
end

View File

@@ -1,5 +1,11 @@
class AddPgTrgmExtension < ActiveRecord::Migration
def change
execute "create extension if not exists pg_trgm"
return if extension_enabled?('pg_trgm')
begin
enable_extension 'pg_trgm'
rescue StandardError => e
raise "Could not create extension pg_trgm. Please contact with your system administrator: #{e}"
end
end
end