Merge branch 'master' into stash
This commit is contained in:
commit
bf7d1e5689
@ -1 +1 @@
|
|||||||
2.2.3
|
2.3.0
|
||||||
|
|||||||
1
Capfile
1
Capfile
@ -12,6 +12,7 @@ require 'capistrano/bundler'
|
|||||||
require 'capistrano/nginx'
|
require 'capistrano/nginx'
|
||||||
require 'capistrano/rails/assets'
|
require 'capistrano/rails/assets'
|
||||||
require 'capistrano/rails/migrations'
|
require 'capistrano/rails/migrations'
|
||||||
|
require 'capistrano/postgresql'
|
||||||
#require 'capistrano/bower'
|
#require 'capistrano/bower'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
7
Gemfile
7
Gemfile
@ -1,5 +1,5 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
ruby '2.2.3'
|
ruby '2.3.0'
|
||||||
gem 'rails', '4.1.8'
|
gem 'rails', '4.1.8'
|
||||||
gem 'sass-rails', '~> 4.0.3'
|
gem 'sass-rails', '~> 4.0.3'
|
||||||
gem 'uglifier', '>= 1.3.0'
|
gem 'uglifier', '>= 1.3.0'
|
||||||
@ -34,6 +34,7 @@ group :development do
|
|||||||
gem 'capistrano-rbenv'
|
gem 'capistrano-rbenv'
|
||||||
gem 'capistrano-nginx', github: 'koenpunt/capistrano-nginx'
|
gem 'capistrano-nginx', github: 'koenpunt/capistrano-nginx'
|
||||||
gem "capistrano-db-tasks", require: false
|
gem "capistrano-db-tasks", require: false
|
||||||
|
gem "capistrano-postgresql", '~> 4.2.0'
|
||||||
gem 'guard-bundler'
|
gem 'guard-bundler'
|
||||||
gem 'guard-rails'
|
gem 'guard-rails'
|
||||||
gem 'guard-rspec'
|
gem 'guard-rspec'
|
||||||
@ -49,14 +50,14 @@ group :development do
|
|||||||
gem 'spring-commands-rspec'
|
gem 'spring-commands-rspec'
|
||||||
gem 'guard-ctags-bundler'
|
gem 'guard-ctags-bundler'
|
||||||
end
|
end
|
||||||
group :development, :test do
|
group :development, :test, :staging do
|
||||||
gem 'factory_girl_rails'
|
gem 'factory_girl_rails'
|
||||||
gem 'faker'
|
gem 'faker'
|
||||||
gem 'pry-rails'
|
gem 'pry-rails'
|
||||||
gem 'pry-rescue'
|
gem 'pry-rescue'
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails'
|
||||||
end
|
end
|
||||||
group :test do
|
group :test, :staging do
|
||||||
gem 'capybara'
|
gem 'capybara'
|
||||||
gem 'database_cleaner'
|
gem 'database_cleaner'
|
||||||
gem "poltergeist"
|
gem "poltergeist"
|
||||||
|
|||||||
@ -60,6 +60,8 @@ GEM
|
|||||||
sshkit (~> 1.2)
|
sshkit (~> 1.2)
|
||||||
capistrano-db-tasks (0.4)
|
capistrano-db-tasks (0.4)
|
||||||
capistrano (>= 3.0.0)
|
capistrano (>= 3.0.0)
|
||||||
|
capistrano-postgresql (4.2.1)
|
||||||
|
capistrano (>= 3.0)
|
||||||
capistrano-rails (1.1.5)
|
capistrano-rails (1.1.5)
|
||||||
capistrano (~> 3.1)
|
capistrano (~> 3.1)
|
||||||
capistrano-bundler (~> 1.1)
|
capistrano-bundler (~> 1.1)
|
||||||
@ -387,6 +389,7 @@ DEPENDENCIES
|
|||||||
capistrano-bundler
|
capistrano-bundler
|
||||||
capistrano-db-tasks
|
capistrano-db-tasks
|
||||||
capistrano-nginx!
|
capistrano-nginx!
|
||||||
|
capistrano-postgresql (~> 4.2.0)
|
||||||
capistrano-rails
|
capistrano-rails
|
||||||
capistrano-rails-console
|
capistrano-rails-console
|
||||||
capistrano-rbenv
|
capistrano-rbenv
|
||||||
|
|||||||
@ -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'
|
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)
|
# If you want to import assets, you can change default asset dir (default = system)
|
||||||
@ -9,7 +9,7 @@ set :assets_dir, %w(public/assets public/system)
|
|||||||
set :branch, proc { `git rev-parse --abbrev-ref stash`.chomp }
|
set :branch, proc { `git rev-parse --abbrev-ref stash`.chomp }
|
||||||
#ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
|
#ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
|
||||||
|
|
||||||
set :deploy_to, '/home/jesse/web/thirteen-tien-len'
|
set :deploy_to, "/home/jesse/web/thirteen-tien-len_#{fetch(:stage)}"
|
||||||
# set :scm, :git
|
# set :scm, :git
|
||||||
|
|
||||||
# set :format, :pretty
|
# set :format, :pretty
|
||||||
@ -20,7 +20,7 @@ set :linked_files, %w{config/database.yml .env}
|
|||||||
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/lift-calculator}
|
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/lift-calculator}
|
||||||
|
|
||||||
set :rbenv_type, :user # or :system, depends on your rbenv setup
|
set :rbenv_type, :user # or :system, depends on your rbenv setup
|
||||||
set :rbenv_ruby, '2.2.3'
|
set :rbenv_ruby, '2.3.0'
|
||||||
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
|
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
|
||||||
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
|
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
|
||||||
set :rbenv_roles, :all # default value
|
set :rbenv_roles, :all # default value
|
||||||
@ -35,6 +35,9 @@ set :nginx_template, 'config/deploy/nginx_conf.erb' # configuration template
|
|||||||
set :nginx_listen, 80 # optional, default is not set
|
set :nginx_listen, 80 # optional, default is not set
|
||||||
set :nginx_roles, :all
|
set :nginx_roles, :all
|
||||||
|
|
||||||
|
## postgresql
|
||||||
|
#set :pg_user, "thirteen_tien_len_#{fetch(:stage)}"
|
||||||
|
|
||||||
namespace :db do
|
namespace :db do
|
||||||
desc 'Setup the database'
|
desc 'Setup the database'
|
||||||
task :setup do
|
task :setup do
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
upstream <%= fetch(:nginx_upstream) %> {
|
upstream <%= fetch(:nginx_upstream) %> {
|
||||||
server unix:///home/jesse/web/thirteen-tien-len/shared/tmp/sockets/puma.sock fail_timeout=0;
|
server unix:///home/jesse/web/thirteen-tien-len_<%= fetch(:stage) %>/shared/tmp/sockets/puma.sock fail_timeout=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
set :stage, :production
|
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
|
# Simple Role Syntax
|
||||||
# ==================
|
# ==================
|
||||||
# Supports bulk-adding hosts to roles, the primary
|
# Supports bulk-adding hosts to roles, the primary
|
||||||
# server in each group is considered to be the first
|
# server in each group is considered to be the first
|
||||||
# unless any hosts have the primary property set.
|
# unless any hosts have the primary property set.
|
||||||
role :app, %w{jesse@ssh.cowabon.ga}
|
role :app, %w{jesse@tienlen.ga}
|
||||||
role :web, %w{jesse@ssh.cowabon.ga}
|
role :web, %w{jesse@tienlen.ga}
|
||||||
role :db, %w{jesse@ssh.cowabon.ga}
|
role :db, %w{jesse@tienlen.ga}
|
||||||
|
|
||||||
# Extended Server Syntax
|
# Extended Server Syntax
|
||||||
# ======================
|
# ======================
|
||||||
@ -17,7 +17,7 @@ role :db, %w{jesse@ssh.cowabon.ga}
|
|||||||
# definition into the server list. The second argument
|
# definition into the server list. The second argument
|
||||||
# something that quacks like a hash can be used to set
|
# something that quacks like a hash can be used to set
|
||||||
# extended properties on the server.
|
# 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
|
# 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
|
# 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),
|
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
||||||
# forward_agent: false,
|
# forward_agent: false,
|
||||||
# auth_methods: %w(password)
|
# auth_methods: %w(password)
|
||||||
port: 27997
|
# port: 27997
|
||||||
}
|
}
|
||||||
# and/or per server
|
# and/or per server
|
||||||
# server 'example.com',
|
# server 'example.com',
|
||||||
|
|||||||
@ -1,13 +1,15 @@
|
|||||||
set :stage, :staging
|
set :stage, :staging
|
||||||
|
|
||||||
|
set :nginx_server_name, 'staging.tienlen.ga' # optional, defaults to :application
|
||||||
|
|
||||||
# Simple Role Syntax
|
# Simple Role Syntax
|
||||||
# ==================
|
# ==================
|
||||||
# Supports bulk-adding hosts to roles, the primary
|
# Supports bulk-adding hosts to roles, the primary
|
||||||
# server in each group is considered to be the first
|
# server in each group is considered to be the first
|
||||||
# unless any hosts have the primary property set.
|
# unless any hosts have the primary property set.
|
||||||
role :app, %w{deploy@example.com}
|
role :app, %w{jesse@staging.tienlen.ga}
|
||||||
role :web, %w{deploy@example.com}
|
role :web, %w{jesse@staging.tienlen.ga}
|
||||||
role :db, %w{deploy@example.com}
|
role :db, %w{jesse@staging.tienlen.ga}
|
||||||
|
|
||||||
# Extended Server Syntax
|
# Extended Server Syntax
|
||||||
# ======================
|
# ======================
|
||||||
@ -15,17 +17,18 @@ role :db, %w{deploy@example.com}
|
|||||||
# definition into the server list. The second argument
|
# definition into the server list. The second argument
|
||||||
# something that quacks like a hash can be used to set
|
# something that quacks like a hash can be used to set
|
||||||
# extended properties on the server.
|
# extended properties on the server.
|
||||||
server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
|
server 'staging.tienlen.ga', user: 'jesse', roles: %w{web app db}, my_property: :my_value
|
||||||
|
|
||||||
# you can set custom ssh options
|
# 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
|
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
|
||||||
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
|
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
|
||||||
# set it globally
|
# set it globally
|
||||||
# set :ssh_options, {
|
set :ssh_options, {
|
||||||
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
||||||
# forward_agent: false,
|
# forward_agent: false,
|
||||||
# auth_methods: %w(password)
|
# auth_methods: %w(password)
|
||||||
# }
|
port: 27997
|
||||||
|
}
|
||||||
# and/or per server
|
# and/or per server
|
||||||
# server 'example.com',
|
# server 'example.com',
|
||||||
# user: 'user_name',
|
# user: 'user_name',
|
||||||
@ -38,5 +41,5 @@ server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
|
|||||||
# # password: 'please use keys'
|
# # password: 'please use keys'
|
||||||
# }
|
# }
|
||||||
# setting per server overrides global ssh_options
|
# setting per server overrides global ssh_options
|
||||||
|
|
||||||
# fetch(:default_env).merge!(rails_env: :staging)
|
# fetch(:default_env).merge!(rails_env: :staging)
|
||||||
|
|
||||||
|
|||||||
98
config/environments/staging.rb
Normal file
98
config/environments/staging.rb
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
Rails.application.configure do
|
||||||
|
# Settings specified here
|
||||||
|
# will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
|
# Code is not reloaded between requests.
|
||||||
|
config.cache_classes = true
|
||||||
|
|
||||||
|
# Eager load code on boot. This eager loads most of Rails and
|
||||||
|
# your application in memory, allowing both threaded web servers
|
||||||
|
# and those relying on copy on write to perform better.
|
||||||
|
# Rake tasks automatically ignore this option for performance.
|
||||||
|
config.eager_load = true
|
||||||
|
|
||||||
|
# Full error reports are disabled and caching is turned on.
|
||||||
|
config.consider_all_requests_local = false
|
||||||
|
config.action_controller.perform_caching = true
|
||||||
|
|
||||||
|
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
||||||
|
# Add `rack-cache` to your Gemfile before enabling this.
|
||||||
|
# For large-scale production use, consider using a caching reverse proxy
|
||||||
|
# like nginx, varnish or squid.
|
||||||
|
# config.action_dispatch.rack_cache = true
|
||||||
|
|
||||||
|
# Disable Rails's static asset server (Apache or nginx will already do this).
|
||||||
|
config.serve_static_assets = false
|
||||||
|
|
||||||
|
# Compress JavaScripts and CSS.
|
||||||
|
config.assets.js_compressor = :uglifier
|
||||||
|
# config.assets.css_compressor = :sass
|
||||||
|
|
||||||
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||||
|
config.assets.compile = false
|
||||||
|
|
||||||
|
# Generate digests for assets URLs.
|
||||||
|
config.assets.digest = true
|
||||||
|
|
||||||
|
# `config.assets.precompile` and `config.assets.version` have moved
|
||||||
|
# to config/initializers/assets.rb
|
||||||
|
|
||||||
|
# Specifies the header that your server uses for sending files.
|
||||||
|
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
||||||
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
||||||
|
|
||||||
|
# Force all access to the app over SSL, use Strict-Transport-Security,
|
||||||
|
# and use secure cookies.
|
||||||
|
# config.force_ssl = true
|
||||||
|
|
||||||
|
# Set to :debug to see everything in the log.
|
||||||
|
config.log_level = :info
|
||||||
|
|
||||||
|
# Prepend all log lines with the following tags.
|
||||||
|
# config.log_tags = [ :subdomain, :uuid ]
|
||||||
|
|
||||||
|
# Use a different logger for distributed setups.
|
||||||
|
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
||||||
|
|
||||||
|
# Use a different cache store in production.
|
||||||
|
# config.cache_store = :mem_cache_store
|
||||||
|
|
||||||
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
|
# config.action_controller.asset_host = "http://assets.example.com"
|
||||||
|
|
||||||
|
# Ignore bad email addresses and do not raise email delivery errors.
|
||||||
|
# Set this to true and configure the email server for
|
||||||
|
# immediate delivery to raise delivery errors.
|
||||||
|
# config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||||
|
# the I18n.default_locale when a translation cannot be found).
|
||||||
|
config.i18n.fallbacks = true
|
||||||
|
|
||||||
|
# Send deprecation notices to registered listeners.
|
||||||
|
config.active_support.deprecation = :notify
|
||||||
|
|
||||||
|
config.action_mailer.smtp_settings = {
|
||||||
|
address: 'smtp.gmail.com',
|
||||||
|
port: 587,
|
||||||
|
domain: Rails.application.secrets.domain_name,
|
||||||
|
authentication: 'plain',
|
||||||
|
enable_starttls_auto: true,
|
||||||
|
user_name: Rails.application.secrets.email_provider_username,
|
||||||
|
password: Rails.application.secrets.email_provider_password
|
||||||
|
}
|
||||||
|
# ActionMailer Config
|
||||||
|
config.action_mailer.default_url_options = { host: Rails.application.secrets.domain_name }
|
||||||
|
config.action_mailer.delivery_method = :smtp
|
||||||
|
config.action_mailer.perform_deliveries = true
|
||||||
|
config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
|
# Disable automatic flushing of the log to improve performance.
|
||||||
|
# config.autoflush_log = false
|
||||||
|
|
||||||
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||||
|
config.log_formatter = ::Logger::Formatter.new
|
||||||
|
|
||||||
|
# Do not dump schema after migrations.
|
||||||
|
config.active_record.dump_schema_after_migration = false
|
||||||
|
end
|
||||||
@ -23,6 +23,15 @@ test:
|
|||||||
domain_name: example.com
|
domain_name: example.com
|
||||||
secret_key_base: b293e2494b3116d86fa96a2a68a5a758c0c0c0d78799e7e948f8beea5c6907c7f4fbe299fa4645bdda6b9a61ba8a73af85a97df09167e2976c1eea55116fb4b6
|
secret_key_base: b293e2494b3116d86fa96a2a68a5a758c0c0c0d78799e7e948f8beea5c6907c7f4fbe299fa4645bdda6b9a61ba8a73af85a97df09167e2976c1eea55116fb4b6
|
||||||
|
|
||||||
|
staging:
|
||||||
|
admin_name: <%= ENV["ADMIN_NAME"] %>
|
||||||
|
admin_email: <%= ENV["ADMIN_EMAIL"] %>
|
||||||
|
admin_password: <%= ENV["ADMIN_PASSWORD"] %>
|
||||||
|
email_provider_username: <%= ENV["GMAIL_USERNAME"] %>
|
||||||
|
email_provider_password: <%= ENV["GMAIL_PASSWORD"] %>
|
||||||
|
domain_name: <%= ENV["DOMAIN_NAME"] %>
|
||||||
|
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||||
|
|
||||||
# Do not keep production secrets in the repository,
|
# Do not keep production secrets in the repository,
|
||||||
# instead read values from the environment.
|
# instead read values from the environment.
|
||||||
production:
|
production:
|
||||||
|
|||||||
@ -7,7 +7,8 @@ feature 'Play a hand', type: :feature, js: true do
|
|||||||
@game = setup_game
|
@game = setup_game
|
||||||
@game.reload
|
@game.reload
|
||||||
@player = @game.controlling_player
|
@player = @game.controlling_player
|
||||||
login_as(@player.user, scope: :user)
|
signin(@player.user.email,'please123')
|
||||||
|
#login_as(@player.user, scope: :user)
|
||||||
visit game_path @game
|
visit game_path @game
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
require 'capybara/poltergeist'
|
require 'capybara/poltergeist'
|
||||||
Capybara.asset_host = 'http://localhost:3000'
|
|
||||||
Capybara.javascript_driver = :poltergeist #:selenium
|
asset_hosts = {
|
||||||
|
staging: 'http://staging.tienlen.ga',
|
||||||
|
development: 'http://localhost:3000',
|
||||||
|
test: 'http://localhost:3000'
|
||||||
|
}
|
||||||
|
|
||||||
|
if ENV['RAILS_ENV'] == 'staging'
|
||||||
|
#Capybara.run_server = false
|
||||||
|
Capybara.app_host = asset_hosts[ENV['RAILS_ENV'].to_sym]
|
||||||
|
end
|
||||||
|
Capybara.asset_host = asset_hosts[ENV['RAILS_ENV'].to_sym]
|
||||||
|
#Capybara.asset_host = 'http://localhost:3000'
|
||||||
|
Capybara.javascript_driver = :selenium # :poltergeist
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user