Commit 0cac1403
Changed files (5)
app
uploaders
app/uploaders/image_uploader.rb
@@ -6,6 +6,8 @@ class ImageUploader < CarrierWave::Uploader::Base
if Rails.env.production?
storage :fog
+ if Rails.env.staging?
+ storage :fog
elsif Rails.env.development?
storage :file
else
app/uploaders/photo_uploader.rb
@@ -12,6 +12,8 @@ class PhotoUploader < CarrierWave::Uploader::Base
# storage :fog
if Rails.env.production?
storage :fog
+ if Rails.env.staging?
+ storage :fog
elsif Rails.env.development?
storage :file
else
config/deploy.rb
@@ -18,31 +18,12 @@ require "rvm/capistrano"
set :rvm_ruby_string, '1.9.2-p290@cakeside'
# set :rvm_type, :user
set :rvm_type, :system
-# set :default_environment, {
-# 'PATH' => "/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-1.9.2-p290@cakeside/bin:/usr/local/rvm/rubies/ruby-1.9.2-p290/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games",
-# 'RUBY_VERSION' => 'ruby-1.9.2-p290',
-# 'GEM_HOME' => '/usr/local/rvm/gems/ruby-1.9.2-p290@cakeside',
-# 'GEM_PATH' => '/usr/local/rvm/gems/ruby-1.9.2-p290@cakeside',
-# 'BUNDLE_PATH' => '/usr/local/rvm/gems/ruby-1.9.2-p290@cakeside' # If you are using bundler.
-# }
-
ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "amazon-cakeside", "cakeside.pem")]
# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts
-# If you are using Passenger mod_rails uncomment this:
-# namespace :deploy do
-# task :start do ; end
-# task :stop do ; end
-# task :restart, :roles => :app, :except => { :no_release => true } do
-# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
-# end
-# end
-#
-#
namespace :deploy do
task :start, :roles => :app do
- # run "cd #{current_path} & rvm use 1.9.2 & rake thinking_sphinx:create RAILS_ENV=production & rake thinking_sphinx:start RAILS_ENV=production"
run "touch #{current_path}/tmp/restart.txt"
end
config/production.sphinx.conf
@@ -1,43 +0,0 @@
-indexer
-{
-}
-
-searchd
-{
- listen = 127.0.0.1:9312
- log = /home/cakeside/apps/www.cakeside.com/current/log/searchd.log
- query_log = /home/cakeside/apps/www.cakeside.com/current/log/searchd.query.log
- pid_file = /home/cakeside/apps/www.cakeside.com/current/log/searchd.production.pid
-}
-
-source creation_core_0
-{
- type = pgsql
- sql_host = localhost
- sql_user = cakeside
- sql_pass = password
- sql_db = cakeside_production
- sql_query_pre = SET TIME ZONE 'UTC'
- sql_query = SELECT "creations"."id" * 1::INT8 + 0 AS "id" , "creations"."name" AS "name", "creations"."story" AS "story", "creations"."id" AS "sphinx_internal_id", 0 AS "sphinx_deleted", 2929256226 AS "class_crc", COALESCE("creations"."name", '') AS "name_sort" FROM "creations" WHERE ("creations"."id" >= $start AND "creations"."id" <= $end) GROUP BY "creations"."id", "creations"."name", "creations"."story", "creations"."id", "creations"."name"
- sql_query_range = SELECT COALESCE(MIN("id"), 1::bigint), COALESCE(MAX("id"), 1::bigint) FROM "creations"
- sql_attr_uint = sphinx_internal_id
- sql_attr_uint = sphinx_deleted
- sql_attr_uint = class_crc
- sql_attr_str2ordinal = name_sort
- sql_query_info = SELECT * FROM "creations" WHERE "id" = (($id - 0) / 1)
-}
-
-index creation_core
-{
- source = creation_core_0
- path = /home/cakeside/apps/www.cakeside.com/current/db/sphinx/production/creation_core
- charset_type = utf-8
- min_infix_len = 1
- enable_star = 1
-}
-
-index creation
-{
- type = distributed
- local = creation_core
-}
config/sphinx.yml
@@ -2,6 +2,8 @@ development:
test:
+staging:
+
production:
enable_star: 1
min_infix_len: 1