Class: EY::Serverside::CLI
Constant Summary
Constants inherited
from Thor
Thor::HELP_MAPPINGS, Thor::THOR_RESERVED_WORDS, Thor::VERSION
Instance Attribute Summary
Attributes included from Thor::Base
#args, #options, #parent_options
Instance Method Summary
collapse
Methods included from CLIHelpers
account_app_env_options, config_option, framework_env_option, instances_options, stack_option, verbose_option
Methods inherited from Thor
check_unknown_options!, check_unknown_options?, default_task, desc, help, #help, long_desc, map, method_option, method_options, printable_tasks, register, subcommand, subcommands, task_help
Methods included from Thor::Base
included, #initialize, register_klass_file, shell, shell=, subclass_files, subclasses
Instance Method Details
#deploy(default_task = :deploy) ⇒ Object
32
33
34
35
|
# File 'lib/engineyard-serverside/cli.rb', line 32
def deploy(default_task=:deploy)
servers, config, shell = init_and_propagate(options, default_task.to_s)
EY::Serverside::Deploy.new(servers, config, shell).send(default_task)
end
|
#disable_maintenance ⇒ Object
52
53
54
55
|
# File 'lib/engineyard-serverside/cli.rb', line 52
def disable_maintenance
servers, config, shell = init_and_propagate(options, 'disable_maintenance')
EY::Serverside::Maintenance.new(servers, config, shell).manually_disable
end
|
#enable_maintenance ⇒ Object
42
43
44
45
|
# File 'lib/engineyard-serverside/cli.rb', line 42
def enable_maintenance
servers, config, shell = init_and_propagate(options, 'enable_maintenance')
EY::Serverside::Maintenance.new(servers, config, shell).manually_enable
end
|
#hook(hook_name) ⇒ Object
71
72
73
74
|
# File 'lib/engineyard-serverside/cli.rb', line 71
def hook(hook_name)
config, shell = init(options, "hook-#{hook_name}")
EY::Serverside::DeployHook.new(config, shell, hook_name).call
end
|
#install_bundler(version) ⇒ Object
123
124
125
126
127
128
129
130
131
132
133
134
135
|
# File 'lib/engineyard-serverside/cli.rb', line 123
def install_bundler(version)
egrep_escaped_version = version.gsub(/\./, '\.')
has_bundler_cmd = "gem list bundler | grep \"bundler \" | egrep -q '#{egrep_escaped_version}[,)]'"
unless system(has_bundler_cmd)
system("gem install bundler -q --no-rdoc --no-ri -v '#{version}'")
end
end
|
#integrate ⇒ Object
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# File 'lib/engineyard-serverside/cli.rb', line 83
def integrate
app_dir = Pathname.new "/data/#{options[:app]}"
current_app_dir = app_dir.join("current")
integrate_options = options.dup
integrate_options[:release_path] = current_app_dir.realpath.to_s
integrate_options[:branch] = current_app_dir.join('REVISION').read.strip
servers, config, shell = init_and_propagate(integrate_options, 'integrate')
shell.logged_system "sudo sh -l -c 'find #{app_dir} -not -user #{config.user} -or -not -group #{config.group} -exec chown #{config.user}:#{config.group} {} +'"
servers.each do |server|
shell.logged_system server.sync_directory_command(app_dir)
shell.logged_system server.command_on_server('sh -l -c', "rm -rf #{current_app_dir}")
end
EY::Serverside::Deploy.new(servers, config, shell).cached_deploy
end
|
117
118
119
120
|
# File 'lib/engineyard-serverside/cli.rb', line 117
def restart
servers, config, shell = init_and_propagate(options, 'restart')
EY::Serverside::Deploy.new(servers, config, shell).restart_with_maintenance_page
end
|