From 4ac48fa07df69cc60f0bfd3ae250063f8cbfd29a Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Tue, 29 Dec 2015 04:40:36 -0800 Subject: [PATCH] Add capistrano-postgresql gem. Update production deploy --- Capfile | 1 + Gemfile | 1 + Gemfile.lock | 3 +++ config/deploy.rb | 5 ++++- config/deploy/production.rb | 12 ++++++------ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Capfile b/Capfile index c6092bed..19dd7591 100644 --- a/Capfile +++ b/Capfile @@ -12,6 +12,7 @@ require 'capistrano/bundler' require 'capistrano/nginx' require 'capistrano/rails/assets' require 'capistrano/rails/migrations' +require 'capistrano/postgresql' #require 'capistrano/bower' diff --git a/Gemfile b/Gemfile index 2958540a..e2c5c1a6 100644 --- a/Gemfile +++ b/Gemfile @@ -34,6 +34,7 @@ group :development do gem 'capistrano-rbenv' gem 'capistrano-nginx', github: 'koenpunt/capistrano-nginx' gem "capistrano-db-tasks", require: false + gem "capistrano-postgresql", '~> 4.2.0' gem 'guard-bundler' gem 'guard-rails' gem 'guard-rspec' diff --git a/Gemfile.lock b/Gemfile.lock index 736d9256..ce2d48e2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,6 +60,8 @@ GEM sshkit (~> 1.2) capistrano-db-tasks (0.4) capistrano (>= 3.0.0) + capistrano-postgresql (4.2.1) + capistrano (>= 3.0) capistrano-rails (1.1.5) capistrano (~> 3.1) capistrano-bundler (~> 1.1) @@ -380,6 +382,7 @@ DEPENDENCIES capistrano-bundler capistrano-db-tasks capistrano-nginx! + capistrano-postgresql (~> 4.2.0) capistrano-rails capistrano-rails-console capistrano-rbenv diff --git a/config/deploy.rb b/config/deploy.rb index 80098184..c9d7a0ba 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,4 +1,4 @@ -set :application, 'thirteen-tien-len' +set :application, "thirteen_tien_len_#{fetch(:stage)}" set :repo_url, 'git@bitbucket.org:jessecfisher/thirteen-tien-len.git' # If you want to import assets, you can change default asset dir (default = system) @@ -34,6 +34,9 @@ set :nginx_template, 'config/deploy/nginx_conf.erb' # configuration template set :nginx_listen, 80 # optional, default is not set set :nginx_roles, :all +## postgresql +#set :pg_user, "thirteen_tien_len_#{fetch(:stage)}" + namespace :db do desc 'Setup the database' task :setup do diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 7d6a7f86..3ca7d471 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,15 +1,15 @@ set :stage, :production -set :nginx_server_name, 'thirteen.cowabon.ga' # optional, defaults to :application +set :nginx_server_name, 'tienlen.ga' # optional, defaults to :application # Simple Role Syntax # ================== # Supports bulk-adding hosts to roles, the primary # server in each group is considered to be the first # unless any hosts have the primary property set. -role :app, %w{jesse@ssh.cowabon.ga} -role :web, %w{jesse@ssh.cowabon.ga} -role :db, %w{jesse@ssh.cowabon.ga} +role :app, %w{jesse@tienlen.ga} +role :web, %w{jesse@tienlen.ga} +role :db, %w{jesse@tienlen.ga} # Extended Server Syntax # ====================== @@ -17,7 +17,7 @@ role :db, %w{jesse@ssh.cowabon.ga} # definition into the server list. The second argument # something that quacks like a hash can be used to set # extended properties on the server. -server 'ssh.cowabon.ga', user: 'jesse', roles: %w{web app db}, my_property: :my_value +server 'tienlen.ga', user: 'jesse', roles: %w{web app db}, my_property: :my_value # you can set custom ssh options # it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options @@ -27,7 +27,7 @@ server 'ssh.cowabon.ga', user: 'jesse', roles: %w{web app db}, my_property: :my_ # keys: %w(/home/rlisowski/.ssh/id_rsa), # forward_agent: false, # auth_methods: %w(password) - port: 27997 +# port: 27997 } # and/or per server # server 'example.com',