adds mailcatcher to foodsoft:setup_development
This commit is contained in:
parent
21c7fa40c1
commit
c42c00b5f1
5 changed files with 42 additions and 41 deletions
5
Gemfile
5
Gemfile
|
@ -45,7 +45,8 @@ end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'sqlite3'
|
gem 'sqlite3'
|
||||||
|
gem 'mailcatcher'
|
||||||
|
|
||||||
# Better error output
|
# Better error output
|
||||||
gem 'better_errors'
|
gem 'better_errors'
|
||||||
gem 'binding_of_caller'
|
gem 'binding_of_caller'
|
||||||
|
@ -63,5 +64,5 @@ group :development do
|
||||||
# Deploy with Capistrano
|
# Deploy with Capistrano
|
||||||
gem 'capistrano', '2.13.5'
|
gem 'capistrano', '2.13.5'
|
||||||
gem 'capistrano-ext'
|
gem 'capistrano-ext'
|
||||||
gem 'common_deploy', require: false, git: 'git://github.com/fsmanuel/common_deploy.git'
|
gem 'common_deploy', require: false, path: '../../common_deploy' #git: 'git://github.com/fsmanuel/common_deploy.git'
|
||||||
end
|
end
|
||||||
|
|
35
Gemfile.lock
35
Gemfile.lock
|
@ -12,8 +12,14 @@ GIT
|
||||||
rake
|
rake
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/fsmanuel/common_deploy.git
|
remote: git://github.com/technoweenie/acts_as_versioned.git
|
||||||
revision: 8c217928bef9dc99d3c95fc8033f97ca7503359c
|
revision: 63b1fc8529d028fae632fe80ec0cb25df56cd76b
|
||||||
|
specs:
|
||||||
|
acts_as_versioned (0.6.0)
|
||||||
|
activerecord (>= 3.0.9)
|
||||||
|
|
||||||
|
PATH
|
||||||
|
remote: ../../common_deploy
|
||||||
specs:
|
specs:
|
||||||
common_deploy (0.0.1)
|
common_deploy (0.0.1)
|
||||||
capistrano (>= 2.13.5)
|
capistrano (>= 2.13.5)
|
||||||
|
@ -21,13 +27,6 @@ GIT
|
||||||
capistrano-resque (~> 0.1.0)
|
capistrano-resque (~> 0.1.0)
|
||||||
rvm-capistrano
|
rvm-capistrano
|
||||||
|
|
||||||
GIT
|
|
||||||
remote: git://github.com/technoweenie/acts_as_versioned.git
|
|
||||||
revision: 63b1fc8529d028fae632fe80ec0cb25df56cd76b
|
|
||||||
specs:
|
|
||||||
acts_as_versioned (0.6.0)
|
|
||||||
activerecord (>= 3.0.9)
|
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
|
@ -94,6 +93,7 @@ GEM
|
||||||
commonjs (0.2.6)
|
commonjs (0.2.6)
|
||||||
daemons (1.1.9)
|
daemons (1.1.9)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
|
eventmachine (1.0.0)
|
||||||
exception_notification (2.6.1)
|
exception_notification (2.6.1)
|
||||||
actionmailer (>= 3.0.4)
|
actionmailer (>= 3.0.4)
|
||||||
execjs (1.4.0)
|
execjs (1.4.0)
|
||||||
|
@ -131,6 +131,15 @@ GEM
|
||||||
i18n (>= 0.4.0)
|
i18n (>= 0.4.0)
|
||||||
mime-types (~> 1.16)
|
mime-types (~> 1.16)
|
||||||
treetop (~> 1.4.8)
|
treetop (~> 1.4.8)
|
||||||
|
mailcatcher (0.5.11)
|
||||||
|
activesupport (~> 3.0)
|
||||||
|
eventmachine (~> 1.0.0)
|
||||||
|
haml (>= 3.1, < 5)
|
||||||
|
mail (~> 2.3)
|
||||||
|
sinatra (~> 1.2)
|
||||||
|
skinny (~> 0.2.3)
|
||||||
|
sqlite3 (~> 1.3)
|
||||||
|
thin (~> 1.5.0)
|
||||||
meta_search (1.1.3)
|
meta_search (1.1.3)
|
||||||
actionpack (~> 3.1)
|
actionpack (~> 3.1)
|
||||||
activerecord (~> 3.1)
|
activerecord (~> 3.1)
|
||||||
|
@ -223,6 +232,9 @@ GEM
|
||||||
rack (~> 1.4)
|
rack (~> 1.4)
|
||||||
rack-protection (~> 1.3)
|
rack-protection (~> 1.3)
|
||||||
tilt (~> 1.3, >= 1.3.3)
|
tilt (~> 1.3, >= 1.3.3)
|
||||||
|
skinny (0.2.3)
|
||||||
|
eventmachine (~> 1.0.0)
|
||||||
|
thin (~> 1.5.0)
|
||||||
sprockets (2.2.2)
|
sprockets (2.2.2)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
|
@ -232,6 +244,10 @@ GEM
|
||||||
test-unit (2.5.3)
|
test-unit (2.5.3)
|
||||||
therubyracer (0.10.2)
|
therubyracer (0.10.2)
|
||||||
libv8 (~> 3.3.10)
|
libv8 (~> 3.3.10)
|
||||||
|
thin (1.5.1)
|
||||||
|
daemons (>= 1.0.9)
|
||||||
|
eventmachine (>= 0.12.6)
|
||||||
|
rack (>= 1.0.0)
|
||||||
thor (0.17.0)
|
thor (0.17.0)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
treetop (1.4.12)
|
treetop (1.4.12)
|
||||||
|
@ -279,6 +295,7 @@ DEPENDENCIES
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari
|
kaminari
|
||||||
localize_input!
|
localize_input!
|
||||||
|
mailcatcher
|
||||||
meta_search
|
meta_search
|
||||||
mysql2
|
mysql2
|
||||||
prawn
|
prawn
|
||||||
|
|
|
@ -6,8 +6,8 @@ set :domain, 'foodsoft.com'
|
||||||
set :user, 'foodsoft'
|
set :user, 'foodsoft'
|
||||||
set :default_stage, 'staging' # staging and production are available via (set :stages, ["staging", "production"])
|
set :default_stage, 'staging' # staging and production are available via (set :stages, ["staging", "production"])
|
||||||
set :keep_releases, 5
|
set :keep_releases, 5
|
||||||
set :deploy_to, "/mnt/apps/manuel/#{application}_#{fetch(:stage, default_stage)}"
|
|
||||||
set :repository, 'git://github.com/foodcoops/foodsoft.git'
|
set :repository, 'git://github.com/foodcoops/foodsoft.git'
|
||||||
|
set(:deploy_to) { "/mnt/apps/#{application}_#{stage}" }
|
||||||
|
|
||||||
|
|
||||||
# resque worker
|
# resque worker
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
begin
|
|
||||||
require "rubygems"
|
|
||||||
require "bundler"
|
|
||||||
rescue LoadError
|
|
||||||
raise "Could not load the bundler gem. Install it with `gem install bundler`."
|
|
||||||
end
|
|
||||||
|
|
||||||
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
|
|
||||||
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
|
|
||||||
"Run `gem install bundler` to upgrade."
|
|
||||||
end
|
|
||||||
|
|
||||||
begin
|
|
||||||
# Set up load paths for all bundled gems
|
|
||||||
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
|
|
||||||
Bundler.setup
|
|
||||||
rescue Bundler::GemNotFound
|
|
||||||
raise RuntimeError, "Bundler couldn't find some gems." +
|
|
||||||
"Did you run `bundle install`?"
|
|
||||||
end
|
|
|
@ -34,15 +34,16 @@ namespace :foodsoft do
|
||||||
setup_development
|
setup_development
|
||||||
setup_database
|
setup_database
|
||||||
setup_secret_token
|
setup_secret_token
|
||||||
|
start_mailcatcher
|
||||||
puts yellow "All done! Your foodcoft should be running smoothly."
|
puts yellow "All done! Your foodcoft should be running smoothly."
|
||||||
start_server
|
start_server
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_bundler
|
def setup_bundler
|
||||||
puts "Installing bundler if not installed..."
|
puts yellow "Installing bundler if not installed..."
|
||||||
%x( if [ -z `which bundle` ]; then gem install bundler --no-rdoc --no-ri; fi )
|
%x( if [ -z `which bundle` ]; then gem install bundler --no-rdoc --no-ri; fi )
|
||||||
puts "Executing bundle install..."
|
puts yellow "Executing bundle install..."
|
||||||
%x( bundle install )
|
%x( bundle install )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -98,16 +99,18 @@ def setup_secret_token
|
||||||
%x( touch #{Rails.root.join("#{file}")}; echo 'Foodsoft::Application.config.secret_token = "#{secret.chomp}"' > #{Rails.root.join("#{file}")} )
|
%x( touch #{Rails.root.join("#{file}")}; echo 'Foodsoft::Application.config.secret_token = "#{secret.chomp}"' > #{Rails.root.join("#{file}")} )
|
||||||
end
|
end
|
||||||
|
|
||||||
def start_server
|
def start_mailcatcher
|
||||||
puts blue "Starting server..."
|
mailcatcher = ask("Do you want to start mailcatcher?\nOptions:\n(y) Yes\n(n) No", ["y","n"])
|
||||||
%x( bundle exec rails s )
|
if mailcatcher === "y"
|
||||||
if $?.to_i === 0
|
puts yellow "Starting mailcatcher at http://localhost:1080..."
|
||||||
puts blue "visit http://localhost:3000"
|
%x( mailcatcher )
|
||||||
else
|
|
||||||
puts red "starting server failed!"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def start_server
|
||||||
|
puts blue "Start your server running 'bundle exec rails s' and visit http://localhost:3000"
|
||||||
|
end
|
||||||
|
|
||||||
def ask(question, answers = false)
|
def ask(question, answers = false)
|
||||||
puts question
|
puts question
|
||||||
input = STDIN.gets.chomp
|
input = STDIN.gets.chomp
|
||||||
|
|
Loading…
Reference in a new issue