Class: Servitor::CLI
- Inherits:
-
Object
- Object
- Servitor::CLI
- Defined in:
- lib/cli/cli.rb
Instance Method Summary collapse
- #autoconfigure ⇒ Object
- #deploy ⇒ Object
- #destroy ⇒ Object
- #halt ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #reup ⇒ Object
- #start ⇒ Object
- #up ⇒ Object
Constructor Details
Instance Method Details
#autoconfigure ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cli/cli.rb', line 12 def autoconfigure SshKey.new(Servitor.ssh_dir).deploy vagrantfile = Vagrantfile.new(services, Servitor.ssh_dir).generate File.open(Servitor.vagrantfile, 'w') do |f| f.write(vagrantfile) end #AppDeployer.deploy(service_definition, infrastructure, shared_service_info) #AppBuilder.build(service_definition, infrastructure, shared_service_info) #AppReleaser.release(service_definition, infrastructure, shared_service_info) end |
#deploy ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cli/cli.rb', line 31 def deploy configuration_provider = YamlConfigurationProvider.new(File.join(Servitor.data_root, 'variables.yml')) service_nodes.each do |service_node| configuration_resolver = ConfigurationResolver.new( service_node.service_definition, configuration_provider, services) variables = configuration_resolver.variables service = services.find {|s| s.name == service_node.service_definition.name} box = VagrantBox.new(service.name) EnvdirDeployer.new(main_box, service.name, service.vm_root, '.envdir', variables).deploy end end |
#destroy ⇒ Object
57 58 59 |
# File 'lib/cli/cli.rb', line 57 def destroy main_box.destroy end |
#halt ⇒ Object
53 54 55 |
# File 'lib/cli/cli.rb', line 53 def halt main_box.halt end |
#reup ⇒ Object
61 62 63 64 |
# File 'lib/cli/cli.rb', line 61 def reup destroy up end |
#start ⇒ Object
27 28 29 |
# File 'lib/cli/cli.rb', line 27 def start main_box.up end |
#up ⇒ Object
47 48 49 50 51 |
# File 'lib/cli/cli.rb', line 47 def up autoconfigure start deploy end |