lib/ors/commands/update.rb in ors-0.2.10 vs lib/ors/commands/update.rb in ors-0.3.0
- old
+ new
@@ -1,17 +1,21 @@
-module ORS::Commands
+class ORS
+ module Commands
+ class Update < Base
- class Update < Base
+ def setup
+ parse_remote_and_or_branch
+ end
- def execute
- info "updating #{name} #{environment}..."
+ def execute
+ info "updating #{ORS.config[:name]} #{ORS.config[:environment]}..."
- execute_in_parallel(all_servers) {|server| update_code server }
- execute_in_parallel(ruby_servers) {|server| bundle_install server }
+ execute_in_parallel(ORS.config[:all_servers]) {|server| update_code(server) }
+ execute_in_parallel(ORS.config[:ruby_servers]) {|server| bundle_install(server) }
- execute_command cron_server, prepare_environment,
- %(if [ -f config/schedule.rb ]; then bundle exec whenever --update-crontab --set environment=#{environment} -i #{name}_#{environment}; fi)
- end
-
+ execute_command(ORS.config[:cron_server],
+ prepare_environment,
+ %(if [ -f config/schedule.rb ]; then bundle exec whenever --update-crontab --set environment=#{ORS.config[:environment]} -i #{ORS.config[:name]}_#{ORS.config[:environment]}; fi))
+ end
+ end # Update < Base
end
-
end