Add capistrano-postgresql gem. Update production deploy

This commit is contained in:
Jesse C. Fisher 2015-12-29 04:40:36 -08:00
parent ae85c90730
commit 4ac48fa07d
5 changed files with 15 additions and 7 deletions

View File

@ -12,6 +12,7 @@ require 'capistrano/bundler'
require 'capistrano/nginx'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/postgresql'
#require 'capistrano/bower'

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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',