Class: VagrantPlugins::Solidus::Site::Start

Inherits:
Subcommand
  • Object
show all
Defined in:
lib/vagrant-solidus/site/start.rb

Direct Known Subclasses

Restart

Constant Summary

Constants included from VagrantPlugins::Solidus::SiteHelpers

VagrantPlugins::Solidus::SiteHelpers::BASE_PORT, VagrantPlugins::Solidus::SiteHelpers::BASE_UTILS_PORT, VagrantPlugins::Solidus::SiteHelpers::DEFAULT_NODE_VERSION, VagrantPlugins::Solidus::SiteHelpers::DEFAULT_NPM_VERSION, VagrantPlugins::Solidus::SiteHelpers::PROVISION_ID, VagrantPlugins::Solidus::SiteHelpers::SITE_STATUS_WATCHER_POLLING_FREQUENCY, VagrantPlugins::Solidus::SiteHelpers::SITE_TEMPLATE_GIT_TAG, VagrantPlugins::Solidus::SiteHelpers::SITE_TEMPLATE_GIT_URL

Instance Method Summary collapse

Methods included from VagrantPlugins::Solidus::SiteHelpers

#build_site, #clone_site_template, #create_site_from_template, #directory_exists?, #fail, #find_port, #follow_site_log, #guest_exec, #help_command_line_option, #host_exec, #install_pow_site, #install_site_dependencies, #install_site_node, #install_site_node_packages, #install_site_service, #ip_address, #load_site, #log, #log_callback, #log_site_log_tail, #log_site_urls, #node_command, #node_version, #npm_version, #pow_installed?, #provisioned!, #provisioned?, #quiet_command_line_option, #save_site, #set_site_ports, #site_commands_arguments, #site_name_command_line_option, #site_responding?, #site_service_name, #site_start_command_line_options, #site_started?, #site_template_command_line_options, #site_watcher_service_name, #sites, #solidus_server_service_name, #start_site_service, #start_site_watcher, #stop_site, #stop_site_service, #uninstall_pow_site, #uninstall_site_service, #validate_site, #wait_for_site_watcher_to_stop, #wait_until_guest_directory_exists, #with_log, #with_mutex

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/vagrant-solidus/site/start.rb', line 15

def execute
  with_running_vm do
    stop_site

    @env.ui.info("Installing site...")
    unless @fast
      fail("Site could not be installed") unless install_site_dependencies && install_site_node && install_site_node_packages
    end
    fail("Out of available ports, add more to the Vagrantfile or remove unused sites from #{SITES_CONFIGS_FILE_HOST_PATH}\nSee https://github.com/solidusjs/vagrant-solidus#adding-or-changing-the-forwarded-ports") unless set_site_ports
    fail("Site could not be installed") unless install_site_service
    install_pow_site if pow_installed?

    @env.ui.info("Building site...")
    fail("Site could not be built") unless build_site

    @env.ui.info("Starting site server and watcher...")
    fail("Site could not be started") unless start_site_service

    if site_responding?
      save_site
      start_site_watcher unless @deaf

      @env.ui.success("#{@site_name} is started, accessible here:")
      log_site_urls
    else
      @env.ui.info("...")
      log_site_log_tail(50)
      fail("Site could not be started")
    end
  end

  # Success, exit status 0
  0
end

#parse_argumentsObject



7
8
9
10
11
12
13
# File 'lib/vagrant-solidus/site/start.rb', line 7

def parse_arguments
  parse_argv do |opts|
    opts.separator "Install and start the site."
    opts.separator ""
    site_start_command_line_options(opts)
  end
end