Module: RubyYacht::Plugins::Nginx

Defined in:
lib/ruby_yacht/plugins/nginx.rb

Overview

This module provides the plugin for managing nginx web servers.

Class Method Summary collapse

Class Method Details

.loadObject

This method loads the configuration for the nginx plugin.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby_yacht/plugins/nginx.rb', line 5

def self.load
  RubyYacht.configure do
    server_type :nginx do
      container_type :web
      baseline_image 'nginx'
    end
  end

  RubyYacht.configure do
    add_hooks container_type: :web, web_server_type: :nginx, script_folder: File.join(File.dirname(__FILE__), 'nginx', 'scripts') do
      during(:install_libraries) { command 'apt-get install -y ruby' }
      during(:install_libraries) { copy_file 'index.html.erb' }
      during(:install_libraries) { copy_file 'index_config.erb' }
      during(:install_libraries) { copy_file 'app_config.erb' }

      during(:add_project_landing) { run_script :ruby, 'add_project.rb' }
      during(:add_app_config) { run_script :ruby, 'add_app.rb' }
    end
  end
end