Class: ORS::Commands::Symlink
- Inherits:
-
Base
- Object
- Base
- ORS::Commands::Symlink
show all
- Defined in:
- lib/ors/commands/symlink.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
26
27
28
|
# File 'lib/ors/commands/symlink.rb', line 26
def description
"Symlinks files in config/deploy/ in given branch (origin/environment by default) to given environment"
end
|
#execute ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/ors/commands/symlink.rb', line 9
def execute
info "symlinking #{ORS.config[:name]} #{ORS.config[:environment]}..."
execute_in_parallel(ORS.config[:ruby_servers]) do |server|
info "[#{server}] symlinking..."
execute_command(server,
prepare_environment,
%(if [ -d config/deploy ]; then cd config/deploy; for i in ./**/*; do if [ -f \\\$i ]; then ln -nfs #{ORS.config[:deploy_directory]}/config/deploy/\\\$i ../../\\\$i; fi; done; cd ../../; fi))
end
end
|
#setup ⇒ Object
5
6
7
|
# File 'lib/ors/commands/symlink.rb', line 5
def setup
parse_remote_and_or_branch
end
|
#usage ⇒ Object
22
23
24
|
# File 'lib/ors/commands/symlink.rb', line 22
def usage
"./ors symlink [remote|remote/branch] [options]"
end
|