Class: ORS::Commands::Deploy
- Inherits:
-
Base
- Object
- Base
- ORS::Commands::Deploy
show all
- Defined in:
- lib/ors/commands/deploy.rb
Instance Method Summary
collapse
Methods inherited from Base
#help, #help_options
#run, #run_without_setup
Methods included from Helpers
#build_command, #execute_command, #execute_in_parallel, #fatal, #info
#bundle_install, #restart_server, #run_migrations, #setup_repo, #setup_ruby, #start_server, #stop_server, #update_code
#prepare_environment, #prepare_environment_with_rvm, #prepare_initial_environment
#parse_remote_and_or_branch
Instance Method Details
#description ⇒ Object
29
30
31
|
# File 'lib/ors/commands/deploy.rb', line 29
def description
"Deploys given branch (origin/environment by default) to given environment"
end
|
#execute ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/ors/commands/deploy.rb', line 9
def execute
info "deploying #{ORS.config[:name]} #{ORS.config[:environment]}..."
[Update, Symlink, Migrate].each {|command| command.run_without_setup }
if ORS.config[:remote_deploy_hook]
execute_in_parallel(ORS.config[:app_servers]) do |server|
execute_command server, prepare_environment, "RAILS_ENV=#{ORS.config[:environment]} #{ORS.config[:remote_deploy_hook]}"
end
end
Restart.run_without_setup
eval ERB.new(ORS.config[:deploy_hook]).result(binding) if ORS.config[:deploy_hook]
end
|
#setup ⇒ Object
5
6
7
|
# File 'lib/ors/commands/deploy.rb', line 5
def setup
parse_remote_and_or_branch
end
|
#usage ⇒ Object
25
26
27
|
# File 'lib/ors/commands/deploy.rb', line 25
def usage
"./ors deploy [remote|remote/branch] [options]"
end
|