Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: jasondew/ors
base: e90bfaf8ac
...
head fork: jasondew/ors
compare: 5e59b4e5eb
  • 4 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
View
8 lib/ors/commands/ruby.rb
@@ -0,0 +1,8 @@
+module ORS::Commands
+ class Ruby < Base
+ def execute
+ info "setting up ruby/rubygems for #{name} #{environment}..."
+ execute_in_parallel(ruby_servers) {|server| setup_ruby server }
+ end
+ end
+end
View
5 lib/ors/commands/setup.rb
@@ -6,9 +6,10 @@ def execute
info "setting up #{name} #{environment}..."
info "Are you sure? ('yes' + ctrl+D^2)"
- if STDIN.read == "yes"
+ if pretending || STDIN.read == "yes"
execute_in_parallel(all_servers) {|server| setup_repo server }
- execute_in_parallel(ruby_servers) {|server| setup_ruby server }
+
+ run Ruby
execute_command migration_server, prepare_environment,
%(RAILS_ENV=#{environment} bundle exec rake db:create)
View
14 lib/ors/helpers.rb
@@ -16,7 +16,7 @@ def setup_repo server
def setup_ruby server
info "[#{server}] installing ruby and gems..."
- execute_command server, prepare_environment,
+ execute_command server, prepare_initial_environment,
%(gem install rubygems-update),
%(gem update --system),
%(gem install bundler),
@@ -128,6 +128,18 @@ def build_command server, *commands_and_maybe_options
end
end
+ def prepare_initial_environment
+ # We do 2 cd's and a git checkout here because the master
+ # branch may not always contain the proper rvmrc/Gemfile
+ # we need when setting up the rest of the deploy
+ prepare_environment + [
+ %(git checkout -q -f origin/#{environment}),
+ %(git reset --hard),
+ %(cd ../),
+ %(cd #{deploy_directory})
+ ]
+ end
+
def prepare_environment
[%(source ~/.rvm/scripts/rvm),
%({ cd #{deploy_directory} > /dev/null; })] # Silence RVM's "Using... gemset..."

No commit comments for this range

Something went wrong with that request. Please try again.