templates/rails_app/config/deploy.rb.tt in railman-0.2.0 vs templates/rails_app/config/deploy.rb.tt in railman-0.3.0

- old
+ new

@@ -1,9 +1,11 @@ # Capistrano deployment tasks lock '3.4.1' -set :application, '<%= app_name %>' +require 'securerandom' + +set :application, '<%= @config.app_name %>' set :repo_url, '<%= @repository.origin %>' set :deploy_to, "/home/deploy/apps/#{fetch(:application)}" set :rbenv_home, '/home/deploy/.rbenv' set :environment, {path: "#{fetch(:rbenv_home)}/shims:#{fetch(:rbenv_home)}/bin:$PATH", rails_env: 'production'} set :log_level, :info @@ -43,10 +45,12 @@ execute :rake, 'assets:precompile' execute :eye, :load, 'Eyefile' execute :eye, :start, fetch(:application) execute :service, "nginx restart" else - warn "TODO: Create .env on the server by copying from .env.example.production and modify your database and smtp settings." + execute :cp, '.env.example.production', '.env' + execute "sed -i -e 's/TODO: generate with: rake secret/#{SecureRandom.hex(64)}/g' .en" + warn "TODO: Edit .env and modify your database and smtp settings." warn "TODO: Create rails secret token with 'rake secret' and insert it into .env" warn "TODO: Create ssl certificates by running the following command as root: /etc/letsencrypt/generate_letsencrypt.sh" warn "TODO: Run 'cap ENV setup' again!" end end