simplify initial database setup deployment rules
This commit is contained in:
parent
af3761fcf5
commit
46b36c42bd
2 changed files with 1 additions and 3 deletions
|
@ -14,8 +14,6 @@ set :user, 'deploy' # ssh deploy user
|
|||
set :default_stage, 'staging' # default environment, see config/deploy/
|
||||
set :keep_releases, 10
|
||||
set :repo_url, 'git://github.com/foodcoops/foodsoft.git'
|
||||
set :unique_app_name, fetch(:application) # for more complex setups, this can be customised
|
||||
# XXX how to get rails environment in here?
|
||||
set :deploy_to, "/www/apps/#{fetch :unique_app_name}"
|
||||
|
||||
# more settings which are probably ok
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace :deploy do
|
|||
task :config => ['deploy:set_rails_env'] do
|
||||
require 'securerandom'
|
||||
on roles(:app), in: :groups do
|
||||
db_name = fetch(:unique_app_name).gsub(/[^-_a-z0-9]/i, '')
|
||||
db_name = (fetch(:db_user) or fetch(:application))
|
||||
db_passwd = SecureRandom.urlsafe_base64(24).to_s
|
||||
db_yaml = {
|
||||
fetch(:rails_env).to_s => {
|
||||
|
|
Loading…
Reference in a new issue